Tricky C Programming MCQs for Problem-Solving

10

A. volatile  B. extern  C. typedef  D. Static

1. Which of the following is not a storage class specifier in C?

Check out the answer here!

A. *a + 3  B. *(a + 3)  C. (a + 3)  D. &(a + 3)

2. How is the 3rd element in an array accessed based on pointer notation?

Check out the answer here!

3. What is the range of values that can be stored by int datatype in C?

Check out the answer here!

A. -(2^31) to (2^31) - 1  B. -256 to 255 C. -(2^63) to (2^63) - 1  D. 0 to (2^31) - 1

4. What does the declaration indicate? int x: 8;

A. x stores a value of 8  B. x is an 8-bit integer  C. Both A and B  D. None of the above

Check out the answer here!

5. Which of the following will occur if we call the free() function on a NULL pointer?

Check out the answer here!

A. Compilation Error  B. Runtime Error  C. Undefined Behaviour  D. Program will execute normally

6. If p is an integer pointer with a value 1000, then what will the value of p + 5 be?

Check out the answer here!

A. 1020  B. 1005  C. 1004  D. 1010

7. What should be used to free memory from a pointer allocated using “new” operator?

Check out the answer here!

A. free()  B. delete C. realloc()  D. None of the above

A. C  B. C++  C. Java  D. Python

8. In which of the following languages is function overloading not possible?

Check out the answer here!

A. r  B. rb  C. w  D. All of the above

9. Which of the following are correct file opening modes in C?

Check out the answer here!

A. Stack  B. Queue  C. Deque  D. Trees

10. Which data structure is used to handle recursion in C?

Check out the answer here!

Are you prepared  to assess C Programming Skills?

Demonstrate your expertise by taking our quiz. Simply click on the ""Try it now"" button to commence. Best of luck!

Enhance your C Programming Skills with Scaler!

Sign up for Scaler's free masterclasses and events to learn about the latest trends in the IT industry and become a pro.  Don't hesitate any longer, register today!