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
61. The default stream pointers available during execution of a program are
- stdin
- stdout
- stdprn
- All of these
62. Which of the following functions used for in-memory format conversions ?
- realloc()
- sprintf()
- fwrite()
- None of these
63. What is argv[0]?
- The number of arguments to the program
- The name of the program
- The first argument to the program
- This syntax is illegal
64. The Turbo C implementation of C language supports
- high level file I/O
- System level file I/O
- Both a and b
- Executable files only
66. Which of the following function is used for writing mixed type of data ?
- fwrite()
- fputs()
- fputc()
- fprintf()
67. which of the following function can be used to read an entire array or structure in a single call ?
- fread()
- read()
- readblock()
- sprintf()
68. the ftell()function
- Takes only one argument
- Takes two arguments
- Moves the file pointer only in forward direction
- None of these
69. The tast performed by fseek (fp,0,0) function is
- fclose(fp)
- search(fp)
- rewind(fp)
- ftell(fp)
70. Which of the following is not a data file in C?
- Text file
- Binary file
- Executable file
- None of these