1.

What will be the output of the following C code?
#include <stdio.h>
int main()
{
int num = 45, *ptr = &num;
function(&num);
printf("%d ", *ptr);
}
void function(int *ptr)
{
int L = 20;
ptr = &L;
printf("%d ", *ptr);
}

A. 20 45
B. 20
C. 45
D. 45 20
E. Compilation Error
Answer» B. 20


Discussion

No Comment Found