MCQOPTIONS
Saved Bookmarks
This section includes 7 Mcqs, each offering curated multiple-choice questions to sharpen your C Programming knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What does argc and argv indicate in command-line arguments? |
| A. | argument control, argument vector |
| B. | argument count, argument variable |
| C. | argument count, argument vector |
| D. | argument control, argument variable |
| E. | None of these |
| Answer» D. argument control, argument variable | |
| 2. |
Which of the following syntax is correct for command-line arguments? |
| A. | int main(char *argv[], int argc) |
| B. | <pre class="prettyprint lang-c">int main()<br> {<br> int argv, char *argc[];<br> }<br></pre> |
| C. | int main(int var, char *varg[]) |
| D. | All of above |
| E. | None of these |
| Answer» D. All of above | |
| 3. |
What will be the output of the following C code (if run with no options or arguments)? |
| A. | Depends on the compiler |
| B. | Nothing |
| C. | 0 |
| D. | 1 |
| E. | None of these |
| Answer» E. None of these | |
| 4. |
A program that has no command line arguments will have argc _________. |
| A. | Two |
| B. | Zero |
| C. | Negative |
| D. | One |
| E. | None of these |
| Answer» E. None of these | |
| 5. |
What will be the output of the following C code (run without any command line arguments)? |
| A. | Compilation Error |
| B. | Segmentation fault |
| C. | Undefined behaviour |
| D. | Nothing |
| E. | main |
| Answer» F. | |
| 6. |
What will be the output of the following C statement? (assuming the input is Welcome to Interview mania ) |
| A. | Interview |
| B. | mania |
| C. | Segmentation Fault |
| D. | (null) |
| E. | None of these |
| Answer» E. None of these | |
| 7. |
In linux, argv[0] by command-line argument can be occupied by _________. |
| A. | ./test |
| B. | ./fun.out.out |
| C. | ./a.out |
| D. | All of above |
| E. | None of these |
| Answer» E. None of these | |