Pointers


  1. What will be the output of the following C code?
    #include <stdio.h>
    void fun(int m, int n)
    {
    int temp = m;
    m = n;
    n = temp;
    }
    void main()
    {
    int s = 16, t = 15;
    fun(s, t);
    printf("%d %d\n", s, t);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    16 15


  1. What will be the output of the following C code?
    #include <stdio.h>
    void fun(int *ptr)
    {
    int k = 0;
    for(k = 0; k < 4; k++)
    printf("%d ", ptr[k]);
    }
    void main()
    {
    int n[5] = {16, 15, 13, 21};
    fun(&n);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    16 15 13 21



  1. What will be the output of the following C code?
    #include <stdio.h>
    void fun(int *ptr1, int *ptr2)
    {
    int temp = *ptr1; *ptr1 = *ptr2; *ptr2 = temp;
    }
    void main()
    {
    int m = 10, n = 12;
    fun(&m, &n);
    printf("%d %d\n", m, n);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    12 10


  1. What is the maximum number of arguments that can be passed in a single function?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    253



  1. Arguments that take input by user before running a program are called?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Command-Line arguments