1.int main() { int see(int); printf("%d",sizeof(see('c')); return 0; } int see(int d) { printf("%d",d); return d; } 2.

void fn(int, int); main() { int a = 5; printf("Main : %d %d\n", a++, ++a); fn(a, a++); } void fn(int a, int b) { printf("Fn : a = %d \t b = %d\n", a, b); } 3. struct foo{ int a; float b; } main() { printf ("check this program before giving output" ); } 4. int main() { char *ptr = "CIC FIRST TEST"; (*ptr)++; printf("%s\n",ptr); ptr++; printf("%s\n",ptr); return 0; } 5.int main() { void format(short); format(-1); return 0; } void format(short l) { short i; for(i=1;i<8*sizeof(short);i++) printf("%d",(l>>sizeof(short)-i)&1); }

6. int main() { short i=(short)300*300/3; printf("%d",i); return 0; } 7. int main() { int i=1,j=0,k=-1,w,z; w= --i && ++j || k--; z= !(i-- && j++) || k++; printf("i=%d j=%d k=%d w=%d z=%d",i,j,k,w,z); return 0; } 8. int main() { int x,y=1,z; if (z=(y!=1)) x=5; else x=10; printf("x=%d\t y = %d\t z=%d ",x,y,z); return 0; } 9. int main() { static char food[]="yummy"; char *ptr; ptr=food + strlen(food); while (--ptr>=food) puts(ptr); return 0; } 10. int main() { int i; for(i=1;i>=0;i++) printf("%d",i); return 0; } 11. int main() { int i=10; #include<stdio.h> /* think about this statement*/ printf("%d %d",++i,i++); printf("%d %d",--i,--i); return 0; }

12. int main() { int *p=100; printf("%d %d",p,*p); *p=30; printf("%d %d",p,*p); return 0; } 13. int main() { int a,b; a=4*printf("me first\n"),5*printf("no me first\n"),3; b=(putch('A'),putch('B'),putch('C')); printf("\na=%d b=%d",a,b); return 0; } 14. int main() { char *s="abc"; char *t; for (t=s;*t!='\0';++t) { switch (*t) { case 'a':putchar('1'); case 'b':putchar('2'); case 'c':putchar('3'); break; } } putchar('\n'); return 0; } 15. struct x { }; struct y { int x }; int main() { printf("%d %d",sizeof(struct x),sizeof(struct y)); } 16. how much memory we can allocate with the help of malloc? 17. int main() { int p,s,i; s=scanf("%c",&i); p=s+printf("i know what printf returns"); printf("s=%d p=%d i=%d",s,p,i); return 0; } what will be the output if input is 'C' ? 18.write a program to add two numbers with using only one defination ' int i' in your program.

19.what is the difference between declaration and defination? give a defination which is not a declaration if exists. give a declaration which is not a defination if exists. 20.int main() { int i,j; scanf("%d%d",&i,&j); printf("i=%d j=%d",++i--,--(j++)); return 0; } 21. int main() { printf("\nXA"); printf("\bBL"); printf("\rAW"); return 0; } 22. #define MAX(x,y) (x) > (y) ? (x) : (y) main() { int i=10,j=5,k=0; k= MAX (i++,++j); printf("%d---%d---%d\n",i,j,k); } 23.#include<stdio.h> main() { char a[10]="\\0\0\2bc"; int i=0; while(i<3) { switch(a[i++]) { case '\\' : printf("\nThis question is good"); break; #define scanf "%s is a string" main() { printf(scanf,scanf); } case 0 : printf("\nThis question is too good"); break; default : printf("\nPredict the output"); } } } 24. main() { char *name[7]={"Kajol","Tabbu","Priti","Neha"}; printf("%d",sizeof(name)/sizeof(char *)); }

25. #define xy(x,y) {int z=67;y=x|y;printf("%d main() { int a=5,b=10; xy(a,b); printf("%d",--z); } 26

%d",x++,y--);};

enum cars{first=1,second=4,third,four=11,five=15,six} what is the value of third and six?

27. The number of arguments that can be passed to main function when we use command line arguments are ___________. 28. int main() { int i=10,j=5; i=swap(i,&j); printf("%d %d",i,j); return 0; } swap(int i,int *j) { int temp=*j; *j=i; return *j,temp; /* here lies the problem */ } 29. main() { const int a=34,b=32; int * const pa=&a; const int *pb=&b; *pa=21; printf("*pa=%d *pb=%d",*pa,*pb); } 30. main() { long a = 0; char i; char *str="vxu"; for(i=0;i<3;i++) a= (a<<8)| str[i] + (i-3); printf("%s", (char *) &a); }