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

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

52. Stream oriented files are accessed through

  • system call
  • Library functions
  • Linker
  • Loader
Show Answer Report

53. What are the two predefined FILE pointes in c?

  • stdout and stderr
  • console and error
  • stdout and stdin
  • stdio and stderr
Show Answer Report

54. Low level files are accessed through

  • System call
  • Library functions
  • Linker
  • Loader
Show Answer Report

55. If an error occurs, the function fseek() returns

  • Non zero
  • Zero
  • No value
  • -1
Show Answer Report

56. A file pointer is

  • A stream pointer
  • A buffer pointer
  • A pointer to a FILE data type
  • All of the above
Show Answer Report

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

58. When fopen( ) fails to open a file it returns

  • NULL
  • -1
  • 1
  • None of these
Show Answer Report

59. The function used for writing a character into a file is

  • putc()
  • fputc()
  • fputchar()
  • Both a and b
Show Answer Report

60. An I/O stream can be

  • A text stream
  • A binary stream
  • Both a and b
  • None of these
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test