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

101. FILE is a

  • Name of a structure
  • Name of a file
  • It is a macro
  • None of the above
Show Answer Report

102. When a file is able to keep information about file that is called

  • header byte
  • Footer byte
  • Slack byte
  • None of the above
Show Answer Report

103. EOF is the symbolic name of

  • 0
  • 1
  • -1
  • None of the above
Show Answer Report

104. What will be the contents of a file void main () { FILE *p p=fopen("letter.txt",w"); putc('D',p); putc('e',p); putc('a',p); putc('r',p); fseek(p,-3, SEEK_cur); putc('i',p); }

  • Dear
  • diar
  • dear i
  • None of the above
Show Answer Report

105. How many streams are opened when data is written from keyboard to buffer and bufer to file.

  • One
  • Two
  • Three
  • Four
Show Answer Report

106. fopen( ) function opens a

  • File
  • Stream
  • Buffer
  • None of the above
Show Answer Report

107. When file is opened for read mode at that itme file pointer gives

  • Fill level
  • empty level
  • Both a and b
  • None of the above
Show Answer Report

108. Which of the following operator is used as file modifier

  • +
  • -
  • *
  • /
Show Answer Report

109. 'putc' s a command to

  • to write character into buffer
  • to write character into stream
  • to write character into monitor
  • to read character into buffer
Show Answer Report

110. The file which contain main () function is called as

  • Application file
  • Module file
  • Complete file
  • None of these
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test