Easy C Quiz - 2
8. How many times will the loop execute?
#include<stdio.h>ANS : Infiniteint main() { char c = 85; while(c = 25) { printf("Everything must comes to an end!"); } }
9. What is the Output of the below C-Code.?
#include<stdio.h>ANS : Compiler Errorint main() { int a = 5 , b = 10 , c = 1; if (a && b > c) { printf("InfiBytes"); } else { break; } }
10. What is the Output of the below C-Code.?
int main() { int a = -12; a = a >> 3; printf("%d", a); }ANS : -2
11. What is the Output of the below C-Code for a 32 bit system.?
#include<stdio.h>ANS : 8 4 4int main() { printf("%d\t", sizeof(6.5)); printf("%d\t", sizeof(9000)); printf("%d\t", sizeof('A')); }
12. What is the Output of the below C-Code.?
int main() { char a,b,c; a = 100; b = 100; c = a+b; printf("%d",c); }ANS : -56
13. How many times will the Loop execute?
for (; ;);ANS : Infinite
14. What is the Output of the below C-Code.?
#include<stdio.h>ANS : 1 == 1 is TRUEint main() { int k=1; printf("%d==1 is ""%s", k, k==1? "TRUE" : "FALSE" ); }
15. What is the Output of the below C-Code.?
#include<stdio.h>ANS : -17int main( ) { char a = 250; int expr; expr = a + !a + a + ++a; printf("%d", expr); return 0; }
16. What is the Output of the below C-Code.?
#include<stdio.h>ANS : 7int main() { int a, b; a = 1, 3, 15; b = (2, 4, 6); printf("%d ", a+b); }
Post a Comment