Learn C MCQs

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

What will be the output of printf("%d", 2 * 3 + 4 * 5);?

1) 32

2) 26

3) 28

4) 22

Answer : Option 2

Which of the following is a correct way to declare a constant in C?

1) const int x = 10;

2) #define x 10

3) Both 1 and 2

4) Neither 1 nor 2

Answer : Option 3

What is the output of printf("%d", 5 ^ 3);?

1) 6

2) 4

3) 7

4) 2

Answer : Option 1

Which of the following operators is used to compare two values for equality?

1) ==

2) !=

3) <

4) >

Answer : Option 1

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

1) 4

2) 8

3) 6

4) 5

Answer : Option 1

Which of the following functions is used to find the length of an array in C?

1) sizeof()

2) length()

3) count()

4) None of the above

Answer : Option 4

What is the output of printf("%d", 3 + 5 * 2);?

1) 10

2) 8

3) 12

4) 14

Answer : Option 1

What is the output of printf("%d", 10 & 2);?

1) 0

2) 2

3) 10

4) 12

Answer : Option 1

Which of the following statements is used to include a header file in C?

1) #include

2) #include

3) include

4) import

Answer : Option 2

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

1) 3

2) 4

3) 2

4) 3.33

Answer : Option 1