Learn C MCQs

Prepare C MCQs (Multiple choice Questions) for exam and job interviews.

What is the result of the expression (5 > 3) && (8 < 2)?

1) 1

2) 0

3) True

4) False

Answer : Option 2

Which function is used to free dynamically allocated memory in C?

1) free()

2) delete()

3) dealloc()

4) release()

Answer : Option 1

Which of the following is a correct syntax for a union in C?

1) union name {int a; float b;};

2) union {int a;};

3) struct name {int a;};

4) None of the above

Answer : Option 1

What is the value of `x` after the following statement: x = 10 % 3;

1) 1

2) 3

3) 2

4) 0

Answer : Option 1

Which of the following is true about the `main` function in C?

1) It must return an integer.

2) It cannot take arguments.

3) It can be defined with any name.

4) None of the above

Answer : Option 1

Which of the following keywords is used for defining a function that does not return a value?

1) void

2) return

3) function

4) none

Answer : Option 1

What will be the output of printf("%d", 5 * 6 / 3);?

1) 10

2) 15

3) 20

4) 30

Answer : Option 1

What does the `break` statement do in a loop?

1) Exits the loop.

2) Continues to the next iteration.

3) Stops the program.

4) None of the above

Answer : Option 1

What will be the output of printf("%d", 10 - 3 + 2);?

1) 5

2) 7

3) 9

4) 10

Answer : Option 3

Which of the following correctly represents a single character variable in C?

1) char a;

2) char a[1];

3) char a();

4) char a{};

Answer : Option 1