< Back To C Tests

C (Basic Test 4)

1. Predict the output of the following code.

n1 = 14, n2 = 15
n1 = 14, n2 = 14
n1 = 15, n2 = 15
n1 = 15, n2 = 14

2. Predict the output of the following code.

BreakInterview
Break
Interview
InterviewBreak

3. Predict the output of the following code.

12
120400
1204
1034

4. Predict the output of the following code.

3
5
Compiler Dependent
Compiler Error

5. Predict the output of the following code.

Break
Interview
Compiler Error
Runtime Error

6. What is the return type of malloc() or calloc()

void*
pointer or allocated memory type
void**
int*

7. Predict the output of the following code

Break
Interview
BreakInterview
Compiler Error

8. Predict the output of the following code.

Infinite Loop
99 99 99
99 98 97
2 2 2

9. In C, static storage class cannot be used with:

Global variable
Function parameter
Function name
Local variable

10. In the following program snippet, both s1 and s2 would be variables of structure type defined as below and there won't be any compilation issue.

True
False