MCQOPTIONS
Saved Bookmarks
This section includes 14 Mcqs, each offering curated multiple-choice questions to sharpen your C Programming Interview knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Is there any difference between the usage of the size() and the length() function? |
| A. | Yes |
| B. | No |
| Answer» C. | |
| 2. |
Given below are 3 lines of code. Select the options given below with respect to the syntactical correctness regarding both C and C++? |
| A. | Lines 1 and 2 are incorrect |
| B. | Lines 2 and 3 are incorrect |
| C. | Only line 1 is incorrect |
| D. | No lines are incorrectView Answer |
| Answer» E. | |
| 3. |
What is the use of the typeid() function? |
| A. | To find the datatype of the variable |
| B. | To find the “const” status of the variable |
| C. | To find the address of the variable |
| D. | To find the value of the variable |
| Answer» B. To find the “const” status of the variable | |
| 4. |
What is the conversion type for reinterpret casting? |
| A. | Pointer to Variable |
| B. | Variable to Variable |
| C. | Pointer to Pointer |
| D. | Variable to Pointer |
| Answer» D. Variable to Pointer | |
| 5. |
Who initiates explicit type casting? |
| A. | The programmer |
| B. | The compiler |
| C. | The microcontroller |
| D. | The assembler |
| Answer» C. The microcontroller | |
| 6. |
Who carries out implicit type casting? |
| A. | The programmer |
| B. | The assembler |
| C. | The compiler |
| D. | The microcontroller |
| Answer» D. The microcontroller | |
| 7. |
What is Type Casting? |
| A. | Converting a file from one type to another |
| B. | Creating new arrays |
| C. | Deleting the variable from memory |
| D. | Converting a variable from one type to another |
| Answer» E. | |
| 8. |
In C++ what type of operator is a cast operator? |
| A. | Unary |
| B. | Binary |
| C. | Ternary |
| D. | Quaternary |
| Answer» B. Binary | |
| 9. |
Which of the following typecasting is accepted by C? |
| A. | Widening conversions |
| B. | Narrowing conversions |
| C. | Widening & Narrowing conversions |
| D. | None of the mentioned |
| Answer» E. | |
| 10. |
Which of the following type-casting have chances for wrap around? |
| A. | From int to float |
| B. | From int to char |
| C. | From char to short |
| D. | From char to int |
| Answer» D. From char to int | |
| 11. |
000000, 7 |
| A. | Run time error |
| B. | 7.000000, junk |
| C. | Varies |
| Answer» B. 7.000000, junk | |
| 12. |
100000, junk value |
| A. | Junk value, 0.100000 |
| B. | 0, 0.100000 |
| C. | 0, 0.999999 |
| Answer» D. | |
| 13. |
Which type of conversion is NOT accepted? |
| A. | From char to int |
| B. | From float to char pointer |
| C. | From negative int to char |
| D. | From double to char |
| Answer» C. From negative int to char | |
| 14. |
2, 1, 2 |
| A. | 2, 1, 1 |
| B. | 2, 1, 4 |
| C. | 2, 2, 8 |
| Answer» D. | |