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

61. The default stream pointers available during execution of a program are

  • stdin
  • stdout
  • stdprn
  • All of these
Show Answer Report

62. Which of the following functions used for in-memory format conversions ?

  • realloc()
  • sprintf()
  • fwrite()
  • None of these
Show Answer Report

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

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

65. Which of the  following is not a valid file opening mode ?

  • r+
  • r
  • +r
  • rt
Show Answer Report

66. Which of the following function is used for writing mixed type of data ?

  • fwrite()
  • fputs()
  • fputc()
  • fprintf()
Show Answer Report

67. which of the following function can be used to read an entire array or structure in a single call ?

  • fread()
  • read()
  • readblock()
  • sprintf()
Show Answer Report

68. the ftell()function

  • Takes only one argument
  • Takes two arguments
  • Moves the file pointer only in forward direction
  • None of these
Show Answer Report

69. The tast performed by fseek (fp,0,0) function is

  • fclose(fp)
  • search(fp)
  • rewind(fp)
  • ftell(fp)
Show Answer Report

70. Which of the following is not a data file in C?

  • Text file
  • Binary file
  • Executable file
  • None of these
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test