Wednesday 27 August 2014

What would be the output of the following following Program?



#include<stdio.h>
#include<conio.h>
void main( )
{
               int a[ ] = {1,2,3,4,5};
               printf("%u,%u,%u",&a,a,&a[0]);
}

Options:

A)65516,65518,65560
B)65516,65516,1
C)65516,1,1
D)65516,65516,65516



Answer Option D)
-->for example the base address of the array a is 65516.
-->a, &a are points to the base address of the array and &a[0] is points to the address of first element in the array i.e base address.
So, answer is 65516,65516,65516.




0 comments:

Post a Comment