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
82. filelength(1) is a function which returns
- Size of file where 1 is a file handler.
- Size of file where 1 is a file descriptor.
- Both a and b
- None of these
84. What is the value of EOF which is declared in "stdio.h"?
- 0
- -1
- Any positive value
- None of the above
85. Which of the following is true ? I. FILE is a data type II. FILE is a storage region III. A block of information in an object of type FILE is recorded while reading or writing
- Option I only
- Both I and II
- Both I and III
- All of the these
86. The function feof() returns
- A file pointer
- A file position pointer
- An jinteger
- None of the above
87. If 'n' is the number of items to be written to the file, when an error occurs duuuuuuuuuuuuuuwrite(), if returns
- A number less than n
- A number equals to n
- A number greater than n
- None of the above
88. The function fread() returns
- the number of filels successfully read
- The number of records successfully read
- the number of bytes successfully read
- None of the above
89. The function fread() returns
- The number of filesl successfully read
- The nuimber of records successfully read
- the number of bytes successfully read
- None of the above
90. The rewind() function is mainly used for
- Open a file for update
- Open a file for writing
- Open a file for reading
- None of these