C Language Programming
C Language Programming
What will be output when you will execute following c code? #include<stdio.h> void main(){ int check=2; switch(check){ case 1: printf("D.W.Steyn"); case 2: printf(" M.G.Johnson"); case 3: printf(" Mohammad Asif"); default: printf(" M.Muralidaran"); } }
What will be output when you will execute following c code? #include<stdio.h> void main(){ int check=2; switch(check){ case 1: printf("D.W.Steyn"); case 2: printf(" M.G.Johnson"); case 3: printf(" Mohammad Asif"); default: printf(" M.Muralidaran"); } }
What will be output when you will execute following c code? #include<stdio.h> void main(){ int movie=1; switch(movie<<2+movie){ default:printf("3 Idiots"); case 4: printf(" Ghajini"); case 5: printf(" Krrish"); case 8: printf(" Race"); } } Choose all that apply: (A) (B) (C) (D) (E) 3 Idiots Ghajini Krrish Race Race Krrish Ghajini Krrish Race Compilation error
What will be output when you will execute following c code? #include<stdio.h> void main(){ int movie=1; switch(movie<<2+movie){ default:printf("3 Idiots"); case 4: printf(" Ghajini"); case 5: printf(" Krrish"); case 8: printf(" Race"); } } Choose all that apply: (A) (B) (C) (D) (E) 3 Idiots Ghajini Krrish Race Race Krrish Ghajini Krrish Race Compilation error
What will be output when you will execute following c code? #include<stdio.h> void main(){ int const X=0; switch(5/4/3){ case X: printf("Clinton"); break; case X+1:printf("Gandhi"); break; case X+2:printf("Gates"); break; default: printf("Brown"); } }
Choose all that apply: (A) (B) (C) (D) (E) Clinton Gandhi Gates Brown Compilation error
What will be output when you will execute following c code? #include<stdio.h> void main(){ int const X=0; switch(5/4/3){ case X: printf("Clinton"); break; case X+1:printf("Gandhi"); break; case X+2:printf("Gates"); break; default: printf("Brown"); } }
Choose all that apply: (A) (B) (C) (D) (E) Clinton Gandhi Gates Brown Compilation error
What will be output when you will execute following c code? #include<stdio.h> void main(){ switch(5/2*6+3.0){ case 3:printf("David Beckham"); break; case 15:printf("Ronaldinho"); break; case 0:printf("Lionel Messi"); break; default:printf("Ronaldo"); } } Choose all that apply: (A) (B) (C) (D) (E) David Beckham Ronaldinho Lionel Messi Ronaldo Compilation error
What will be output when you will execute following c code? #include<stdio.h> void main(){ switch(5/2*6+3.0){ case 3:printf("David Beckham"); break; case 15:printf("Ronaldinho"); break; case 0:printf("Lionel Messi"); break; default:printf("Ronaldo"); } } Choose all that apply: (A) (B) (C) (D) (E) David Beckham Ronaldinho Lionel Messi Ronaldo Compilation error
What will be output when you will execute following c code? #include<stdio.h> void main(){ int x=-1,y=-1; if(++x=++y) printf("R.T. Ponting"); else printf("C.H. Gayle"); } Choose all that apply: (A) (B) (C) (D) (E) R.T Ponting C.H. Gayle Warning: x and y are assigned a value that is never used Warning: Condition is always true Compilation error
What will be output when you will execute following c code? #include<stdio.h> void main(){ int x=-1,y=-1; if(++x=++y) printf("R.T. Ponting"); else printf("C.H. Gayle"); } Choose all that apply: (A) (B) (C) (D) (E) R.T Ponting C.H. Gayle Warning: x and y are assigned a value that is never used Warning: Condition is always true Compilation error
#include<stdio.h> void main(){ int m=5,n=10,q=20; if(q/n*m) printf("William Gates"); else printf(" Warren Buffet"); printf(" Carlos Slim Helu"); }
Choose all that apply: (A) (B) (C) (D) (E) William Gates Warren Buffet Carlos Slim Helu Run time error Compilation error None of the above
#include<stdio.h> void main(){ int m=5,n=10,q=20; if(q/n*m) printf("William Gates"); else printf(" Warren Buffet"); printf(" Carlos Slim Helu"); }
Choose all that apply: (A) (B) (C) (D) (E) William Gates Warren Buffet Carlos Slim Helu Run time error Compilation error None of the above
What will be output when you will execute following c code? #include<stdio.h> void main(){ int xxx[10]={5}; printf("%d %d",xxx[1],xxx[9]); } Choose all that apply: (A) (B) (C) (D) (E) Garbage Garbage 00 null null Compilation error None of the above
What will be output when you will execute following c code? #include<stdio.h> void main(){ int xxx[10]={5}; printf("%d %d",xxx[1],xxx[9]); } Choose all that apply: (A) (B) (C) (D) (E) Garbage Garbage 00 null null Compilation error None of the above
What will be output if you will compile and execute the following c code?
#define x 5+2 void main(){ int i; i=x*x*x; printf("%d",i); } OUTPUT: (A) 343 (B) 27 (C) 133 (D) Compiler error (E) None of above
What will be output if you will compile and execute the following c code?
#define x 5+2 void main(){ int i; i=x*x*x; printf("%d",i); } OUTPUT: (A) 343 (B) 27 (C) 133 (D) Compiler error (E) None of above
What will be output if you will compile and execute the following c code?
void main(){ int i=4,x; x=++i + ++i + ++i; printf("%d",x); } OUTPUT: (A) 21 (B) 18 (C) 12 (D) Compiler error (E) None of above
What will be output if you will compile and execute the following c code?
void main(){ int i=4,x; x=++i + ++i + ++i; printf("%d",x); } OUTPUT: (A) 21 (B) 18 (C) 12 (D) Compiler error (E) None of above
What will be output if you will compile and execute the following c code?
What will be output if you will compile and execute the following c code?
What will be output if you will compile and execute the following c code?
void main(){ int x; for(x=1;x<=5;x++); printf("%d",x); } OUTPUT: (A) 4 (B) 5 (C) 6 (D) Compiler error (E) None of above
What will be output if you will compile and execute the following c code?
void main(){ int x; for(x=1;x<=5;x++); printf("%d",x); } OUTPUT: (A) 4 (B) 5 (C) 6 (D) Compiler error (E) None of above
What will be output if you will compile and execute the following c code?
What will be output if you will compile and execute the following c code?
What will be output of the following c program? #include<stdio.h> int main(){ long int new=5l; printf("%ld",new); return 0; } OUTPUT:
What will be output of the following c program? #include<stdio.h> int main(){ long int new=5l; printf("%ld",new); return 0; } OUTPUT:
What will be output of the following c program? #include<stdio.h> int main(){ long int _=5l; printf("%ld",_); return 0; } OUTPUT: 5 51 0 Compilation error None of these
What will be output of the following c program? #include<stdio.h> int main(){ long int _=5l; printf("%ld",_); return 0; } OUTPUT: (A) 5 (B) 51 (C) 0 (D) Compilation error (E) None of these
What will be output of the following c program? #include<stdio.h> int main(){ long int a; (float)a=6.5; printf("%f",a); return 0; } OUTPUT: (A) 6.5 (B) 6.500000 (C) 7.000000 (D) Compilation error (E) None of these
What will be output of the following c program? #include<stdio.h> int main(){ long int a; (float)a=6.5; printf("%f",a); return 0; } OUTPUT: (A) 6.5 (B) 6.500000 (C) 7.000000 (D) Compilation error (E) None of these
What will be output of the following c program? #include<stdio.h> int main(){ const a=10; a=~a; printf("%d",a); return 0; }
OUTPUT: (A) 10 (B) -11 (C) 12 (D) Compilation error (E) None of these
What will be output of the following c program? #include<stdio.h> int main(){ const a=10; a=~a; printf("%d",a); return 0; }
OUTPUT: (A) 10 (B) -11 (C) 12 (D) Compilation error (E) None of these
Answer: 54321
#include<stdio.h> main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }
#include<stdio.h> main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } } Answer:Compiler Error: Constant expression required in function main