Elearning , Interview Questions And Answers

Google

c)2 d)undefined ans:2 15. #include<stdio.h> void main(int argc) { char a[]={'1','2','3',0,'1','2','3'}; printf(a); } a) compilation error, b) 123, c) 123 123, d) 1230123 ANS:b 16. #include<stdio.h> void func(int *x) { x=(int *) malloc(sizeof(int)); printf("in func: %p\n",x); } void main(int argc) { int **pp; int *p; pp=(int **) malloc(sizeof(int *)); p=(int *) malloc(sizeof((int)); *pp=p; printf("first:%p \n",*pp); func(*pp); printf("last %p \n",*pp); } assuming the p is equal to 1000 and x is equal to 2000 atfer malloc calls a) 1000,2000,1000, b) 1000,2000,2000, c) 1000,1000,1000 d) 2000,2000,2000 ANS:a 17. #include<stdio.h> #define const const void main(int argc) { const int x=0; }


Hosted by www.Geocities.ws

1