Examveda
Examveda

What will be the output of the following C code?
#include <stdio.h>
void m(int *p)
{
    int i = 0;
    for(i = 0;i < 5; i++)
    printf("%d\t", p[i]);
}
void main()
{
    int a[5] = {6, 5, 3};
    m(&a);
}

A. 0 0 0 0 0

B. 6 5 3 0 0

C. Run time error

D. 6 5 3 junk junk

Answer: Option B


This Question Belongs to C Program >> Pointer

Join The Discussion

Related Questions on Pointer