☰
×
Home
◈ Introduction
C - Data Types IQ
◈ C Data Type Tricky - I
◈ C Data Type Tricky - II
◈ C Data Type Tricky - III
◈ C Data Type Tricky - IV
◈ C Data Type Tricky - V
C - Operators IQ
◈ C Operators Tricky - I
◈ C Operators Tricky - II
◈ C Operators Tricky - III
Choose the Correct
◈ Choose the Correct Ans - I
◈ Choose the Correct Ans- II
◈ Choose the Correct Ans - III
◈ Choose the Correct Ans - IV
◈ Choose the Correct Ans - V
◈ Choose the Correct Ans - VI
Find Output - Tricky
◈ C Pgm Tricky Questions I
◈ C Pgm Tricky Questions II
◈ C Pgm Tricky Questions III
◈ C Pgm Tricky Questions IV
◈ C Pgm Tricky Questions V
◈ C Pgm Tricky Questions VI
◈ C Pgm Tricky Questions VII
◈ C Pgm Tricky Questions VIII
◈ C Pgm Tricky Questions IX
C - General IQ
◈ General C Questions I
◈ General C Questions II
◈ General C Questions III
◈ General C Questions IV
◈ General C Questions V
◈ General C Questions VI
◈ General C Questions VII
Home
About
Consulting
Training
Tutorial
Interview Questions
Contact
Interview Questions
C Tricky - Find Output
Home
C Interview Questions
◈ Introduction
C Data Types Tricky Questions
◈ C Data Type Tricky Questions I
◈ C Data Type Tricky Questions II
◈ C Data Type Tricky Questions III
◈ C Data Type Tricky Questions IV
◈ C Data Type Tricky Questions V
C Operators Interview Questions
◈ C Operators Tricky Questions I
◈ C Operators Tricky Questions II
◈ C Operators Tricky Questions III
Choose the Correct Answer
◈ Choose the Correct Answer I
◈ Choose the Correct Answer II
◈ Choose the Correct Answer III
◈ Choose the Correct Answer IV
◈ Choose the Correct Answer V
◈ Choose the Correct Answer VI
Find Output - Tricky C Program
◈ C Programs Tricky Questions I
◈ C Programs Tricky Questions II
◈ C Programs Tricky Questions III
◈ C Programs Tricky Questions IV
◈ C Programs Tricky Questions V
◈ C Programs Tricky Questions VI
◈ C Programs Tricky Questions VII
◈ C Programs Tricky Questions VIII
◈ C Programs Tricky Questions IX
General C Interview Questions
◈ General C Questions I
◈ General C Questions II
◈ General C Questions III
◈ General C Questions IV
◈ General C Questions V
◈ General C Questions VI
◈ General C Questions VII
C Programming Interview Questions
C Tricky Questions - Find Output V
« Prev
Next »
C Tricky Questions - Find Output
Program 81 #include
int try(int a,int b,int c) { if((a>=b)&&(c
=b) return try(a,c,b); else return try(b,a,c); } main() { printf("%d\n",try(1,2,3)); } Program 82 #include
int count(int i) { static int count=0; count=count+i; return count; } main() { int i,j; for(i=0;i<=5;i++) j=count(i); printf("%d\n",j); } Program 83 #include
main() { int i=3,j; j=i++ + ++i; printf("%d\n",j); } Program 84 #include
int f(int n) { int x; if(n==0) x=0; else x=n+f(n-1); return x; } main() { int n; printf("%d\n",f(5)); } Program 85 #include
main() { int i,j; i=1; j=5; for(;++i<--j;) continue; printf("%d %d \n",i,j); } Program 86 #include
main() { float a[3]; printf("%d ",sizeof(a)); printf("%d \n",sizeof(&a)); } Program 87 #include
main() { union type{ int in; long out; }u={65}; printf("%ld\n",u.out); } Program 88 #include
void bin(unsigned i) { unsigned n=2; for(n=n<<6;n>0;n=n/2) if(i&n) printf("1 "); else printf("0 "); printf("\n"); } main() { unsigned char c; c=65; bin(c); } Program 89 #include
main() { struct test{ int i; char c; union { int iu; char cu; }u; }; struct test su={0}; printf("%d %d %d %d",su.u.cu,su.u.iu,su.c,su.i); } Program 90 #include
void tmp(char *s) { char *q=++s; while(*q) ++q; printf("%u %u\n",*q,*s); printf("%d\n",q-s); } main() { char *p="abcdef"; tmp(p); } Program 91 #include
void tmp(char *s) { char *q=&s[6]; char *p=&s[6]; ++p; printf("%d\n",p-q); ++p; printf("%d\n",p-q); } main() { char *p="abcdef"; tmp(p); } Program 92 #include
int x=3; int y=5; main() { //int x=x; volatile int x=x; static y; y=y; printf("%d %d\n",x,y); } Program 93 #include
main() { while(1) { int i=0; while(i<10) { ++i; printf("%d \n",i); for(;;) { if(++i<5) continue; break; } } printf("%d ",i); break; } } Program 94 #include
main() { int sum; enum tmp{A,B,C=5,D,E}; sum=A+B+C+D+E; printf("sum=%d\n",sum); } Program 95 #include
main() { int a=2; if(++a^++a && (a^a) || ++a) printf("%d\n",a); } Program 96 #include
main() { unsigned int a=2; unsigned int b=3; unsigned int c=5; a<<=c>b>a ^ a
main() { unsigned int i,j; union{ unsigned int i; unsigned char a[2]; }u={129}; int n; n=1; while(n-- >0) { j=((u.a[0]&1)<<7); u.a[0]=u.a[0]>>1; u.a[0]=u.a[0] |j; } printf("%d\n",u.i); } Program 98 #include
main() { int i=5; switch(i) { static int i; i=3; i=i*i; case 3:i=i+i; case 4:i=i+i; case 5:i=i+i; default:i=i+i; printf("%d\n",i); } printf("%d\n",i); } Program 99 #include
void f(int x) { int i=x; { static i; i=i; i=i+x; printf("%d \t",i); } i=i+x; printf("%d \t",i); } main() { f(2); f(3); } Program 100 #include
main() { static a[3]={1}; int b[3]={1}; printf("%d %d \n",a[2],b[2]); }
« Prev
Next »
Helpful Links
Sateeshkg Home
Interview Questions
Corporate Training
Recommended Books
Linux Consulting
Apply for Job Assistance
If you have any queries please email us at
info@motionzen.com