C-Command Line Arguments Questions and Answers
Command line arguments in C allow passing values to a program at runtime through the main() function parameters argc and argv. This feature is essential for flexible and interactive program execution. Many programming questions and answers in coding interviews test this concept through practical applications and debugging scenarios. This section provides C command line argument questions with answers and explanations, helping learners strengthen their understanding of runtime input handling. These examples are useful for TCS, Tech Mahindra, and Wipro placement exams where efficiency and clarity of coding are tested.
C-Command Line Arguments
Showing 10 of
129 questions
51. The fcloseall() function
- Closes all filesl except stdprn and stderr
- Closes all files except stdin and stdout
- It returns the name of the last file closed
- None of these
52. Stream oriented files are accessed through
- system call
- Library functions
- Linker
- Loader
53. What are the two predefined FILE pointes in c?
- stdout and stderr
- console and error
- stdout and stdin
- stdio and stderr
54. Low level files are accessed through
- System call
- Library functions
- Linker
- Loader
56. A file pointer is
- A stream pointer
- A buffer pointer
- A pointer to a FILE data type
- All of the above
57. Find the output #include "stdio.h" void main( ) { int x=10; char ch[10]; sprintf(ch,"%d",x); printf("%s",ch); }
- 25
- Garbage value
- Compilation error
- None of these
59. The function used for writing a character into a file is
- putc()
- fputc()
- fputchar()
- Both a and b
60. An I/O stream can be
- A text stream
- A binary stream
- Both a and b
- None of these