Professional Documents
Culture Documents
1. #include <stdio.h>
2. int main()
3. {
4. int y = 10000;
5. int y = 34;
6. printf("Hello World!
%d\n", y);
7. return 0;
8. }
1. #include <stdio.h>
2. int main()
3. {
4. int main = 3;
5. printf("%d", main);
6. return 0;
7. }
3
10 C01 L2 2
All keywords in C are in ____________
a) LowerCase letters
b) UpperCase letters
c) CamelCase letters
d) None of the mentioned
11 What will be the final value of x in the C01 L2 2
following C code?
1. #include <stdio.h>
2. void main()
3. {
4. int x = 5 * 9 / 3 + 9;
5. }
a) 3.75
b) Depends on compiler
c) 24
d) 3
1. #include <stdio.h>
2. int main()
3. {
4. short int i = 20;
5. char c = 97;
6. printf("%d, %d, %d\n",
sizeof(i), sizeof(c),
sizeof(c + i));
7. return 0;
8. }
a) 2, 1, 2
b) 2, 1, 1
c) 2, 1, 4
d) 2, 2, 8
4
1. #include <stdio.h>
2. int main()
3. {
4. int i = 0;
5. while (i < 3)
6. i++;
7. printf("In while
loop\n");
8. }
a) 2
b) 3
c) 4
d) 1
Answers
1 2 3 4 5 6 7 8
A D B A B C A D
9 10 11 12 13 14 15
C A C D C D C