MCQOPTIONS
Saved Bookmarks
This section includes 5 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. |
Which of the following is not a pointer declaration? |
| A. | char a[10]; |
| B. | char a[] = {‘1’, ‘2’, ‘3’, ‘4’}; |
| C. | char *str; |
| D. | char a; |
| Answer» E. | |
| 2. |
Which keyword is used to prevent any changes in the variable within a C program? |
| A. | immutable |
| B. | mutable |
| C. | const |
| D. | volatile |
| Answer» D. volatile | |
| 3. |
Which of the following declaration is illegal? |
| A. | char *str = “Best C programming classes by Sanfoundry”; |
| B. | char str[] = “Best C programming classes by Sanfoundry”; |
| C. | char str[20] = “Best C programming classes by Sanfoundry”; |
| D. | char[] str = “Best C programming classes by Sanfoundry”; |
| Answer» E. | |
| 4. |
The name of the variable used in one function cannot be used in another function. |
| A. | True |
| B. | False |
| C. | May be |
| D. | None of the mentioned |
| Answer» C. May be | |
| 5. |
A variable declared in a function can be used in main(). |
| A. | True |
| B. | False |
| C. | True if it is declared static |
| D. | None of the mentioned |
| Answer» C. True if it is declared static | |