Home » C Programming » Pointers » Question
  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. Compilation Error
    2. 10 12
    3. 12 10
    4. Garbage value
    5. None of these
Correct Option: C

12 10



Your comments will be displayed only after manual approval.