Command Line Arguments in C language MCQs

@T-Bone

This question paper focuses on the "Command Line Arguments" of the C programming. These Multiple Choice Questions (mcq) should be practiced to improve the C programming skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

This question paper focuses on the "Command Line Arguments" of the C programming. These Multiple Choice Questions (mcq) should be practiced to improve the C programming skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

Questions

1. The command line arguments are handled using?

Mark the correct option

2. argc refers to the?

Mark the correct option

3. argv[] is a?

Mark the correct option

4. In linux, argv[0] by command-line argument can be occupied by _________

Mark the correct option

5. What type of array is generally generated in Command-line argument?

Mark the correct option

6. What is the index of the last argument in command line arguments?

Mark the correct option

7. What will be output for the following code? #include <stdio.h> int main(int argc, char *argv[]) { printf(""%d "", argc); return 0; }

Mark the correct option

8. What will be output for the following code? #include <stdio.h> int main(int argc, char *argv[]) { printf(""%s "", argv[argc]); return 0; }

Mark the correct option

9. What will be output for the following code? #include <stdio.h> int main(int argc, char *argv[]) { printf(""%s "", argv[-1]); return 0; }

Mark the correct option

10. What will be output for the following code? #include <stdio.h> int main(int argc, char *argv[]) { while (*argv != NULL) printf(""%s "", *(argv++)); return 0; }

Mark the correct option

Index of Questions