Professional Documents
Culture Documents
(D) x = 0
*ptr = 0
x=0
*ptr = 0
x=0
*ptr = 0
14. What would be the output of the 15. Would the following code compile
following program? successfully?
main()
{ main()
char far *a=0x00000120; {
char far *b=0x00100020; Printf(“%c”,7[‘Sundaram’]);
char far *c=0x00120000; }
if(a==b)
printf(“\nHello”); a) Yes it will print sundara.
if(a==c) b) No it will show compilation error.
printf(“\nHi”); c) Yes print m of sundaram.
if(b==c) d) None
printf(“\nHello Hi”);
if(a>b && a>c&& b>c)
printf(“\nBye”);
}
16. In the following program how 17.What would be the output of the
would you print 50 using p? following program?
main() main()
{
{ Int arr[]={12, 13, 14, 15, 16};
Printf(“\n%d %d %d”, sizeof(arr),
Int a[]={10,20,30,40,50};
sizeof(*arr), sizeof(arr[0]));
char *p; }
p = (char *)a a) 12 13 14 16
} b) 10 12 15 16
c) 10 2 2
d) None
21. What is the output of this C code? 22.What will be the output of following
int main() program ?
{ #include <stdio.h>
int *ptr, a = 10; int main()
ptr = &a; {
*ptr += 1; char *str
printf("%d,%d/n", *ptr, a); []={"AAAAA","BBBBB","CCCCC","DDDD
} D"};
A. 10,10 B. 10,11 C. 11,11 D. 11,10 char **sptr []={str+3,str+2,str+1,str};