< Back To C Tests

C (Basic Test 3)

1. Predict the output of the following code.

10
11
9
Compiler Error

2. Predict the output of the following code.

2004
2002
2020
lvalue required

3. Predict the output of the following code

A
B
C
Compiler Error

4. Pick the best statement for the below program:

Compile error because arr has been defined using struct type incorrectly. First struct type should be defined using tag and then arr should be defined using that tag.
Compile error because apart from definition of arr, another issue is in the initialization of array of struct i.e. arr[].
No compile error and it’ll print 1 2 0 0
No compile error and it’ll print 1 0 2 0

5. Predict the output of the following code.

k
I
Compiler Error
Runtime Error

6. Predict the output of the following code.

5 4 3
3 4 5
5 5 5
Compiler Dependent

7. Which of the following operators can be applied on structure variables?

Assignment Operator(=)
Equality Comparison (==)
Both of the above
None of the above

8. Predict the output of the following code.

6 -6 0 0
6 -5 0 1
-6 -6 0 1
6 -6 0 1

9. What is the output of this C code?

4
1
Compiler Dependent
Depends on the endianness of the machine

10. Predict the output of the following code.

true 2
false 2
Either option a or option b
true 1