C-Command Line Arguments Questions and Answers

Take Exam

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

81. How many types of attributes present in a file ?

  • 2
  • 3
  • 4
  • 5
Show Answer Report

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
Show Answer Report

83. O_TRUNC always followed by

  • WRONLY
  • RDONLY
  • RDWRONLY
  • None o the above
Show Answer Report

84. What is the value of EOF which is declared in "stdio.h"?

  • 0
  • -1
  • Any positive value
  • None of the above
Show Answer Report

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
Show Answer Report

86. The function feof() returns

  • A file pointer
  • A file position pointer
  • An jinteger
  • None of the above
Show Answer Report

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
Show Answer Report

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
Show Answer Report

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
Show Answer Report

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
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test