Question 1 of 25
Hints left: 3
Q1
What will be the output of the following C code? #include <stdio.h> int main() { int a = 0, i = 0, b; for (i = 0;i < 5; i++) { a++; if (i == 3) break; } }
Q2
What will be the output of the following C code? #include <stdio.h> void main() { int i = 0; if (i == 0) { printf("Hello"); continue; } }
Q3
What will be the output of the following C code? #include <stdio.h> int main() { int i = 0, j = 0; while (l1: i < 2) { i++; while (j < 3) { printf("loop\n"); goto l1; } } }
Q4
What will be the output of the following C code? #include <stdio.h> int main() { int x = 0; if (x++) printf("true\n"); else if (x == 1) printf("false\n"); }
Q5
What will be the output of the following C code? #include <stdio.h> void main() { int x = 5; if (true); printf("hello"); }
Q6
Which keyword is used to come out of a loop only for that iteration?
Q7
What will be the output of the following C code? #include <stdio.h> #define max(a) a int main() { int x = 1; switch (x) { case max(2): printf("yes\n"); case max(1): printf("no\n"); break; } }
Q8
What will be the output of the following C code? #include <stdio.h> int main() { int i = 0, j = 0; while (i < 5, j < 10) { i++; j++; } printf("%d, %d\n", i, j); }
Q9
How many times while loop condition is tested in the following C code snippets, if i is initialized to 0 in both the cases? while (i < n) i++; ————- do i++; while (i <= n);
Q10
What will be the output of the following C code? #include <stdio.h> void main() { int i = 0; if (i == 0) { goto label; } label: printf("Hello"); }
Q11
What will be the output of the following C code? #include <stdio.h> switch (ch) { case 'a': case 'A': printf("true"); }
Q12
What will be the output of the following C code? #include <stdio.h> int main() { printf("%d ", 1); l1:l2: printf("%d ", 2); printf("%d\n", 3); }
Q13
What will be the output of the following C code? #include <stdio.h> int main() { printf("before continue "); continue; printf("after continue\n"); }
Q14
What will be the output of the following C code? #include <stdio.h> void main() { int x = 0; if (x == 0) printf("hi"); else printf("how are u"); printf("hello"); }
Q15
goto can be used to jump from main() to within a function.
Q16
What will be the output of the following C code? #include <stdio.h> void main() { int k = 0; for (k < 3; k++) printf("Hello"); }
Q17
What will be the output of the following C code? #include <stdio.h> const int a = 1, b = 2; int main() { int x = 1; switch (x) { case a: printf("yes "); case b: printf("no\n"); break; } }
Q18
What will be the output of the following C code? #include <stdio.h> int main() { int a = 0, i = 0, b; for (i = 0;i < 5; i++) { a++; continue; } }
Q19
What will be the output of the following C code? #include <stdio.h> int main() { int a = 1; if (a) printf("All is Well "); printf("I am Well\n"); else printf("I am not a River\n"); }
Q20
What will be the output of the following C code? #include <stdio.h> void main() { int i = 0; if (i == 0) { printf("Hello"); break; } }
Q21
What will be the output of the following C code? #include <stdio.h> void main() { int x = 5; if (x < 1); printf("Hello"); }
Q22
Which keyword can be used for coming out of recursion?
Q23
The C statement ""if (a == 1 || b == 2) {}"" can be re-written as . . . . . . . .
Q24
What will be the output of the following C code? #include <stdio.h> void main() { int i = 0, k; if (i == 0) goto label; for (k = 0;k < 3; k++) { printf("hi "); label: k = printf("%03d", i); } }
Q25
What will be the output of the following C code? #include <stdio.h> int main() { int i = 0; while (i = 0) printf("True\n"); printf("False\n"); }