C-Command Line Arguments Questions and Answers

Practice Mode
Showing 10 of 129 questions
Q1
The maximum combined length of the command-line arguments including the spaces between adjacent arguments is
  • A 128 characters
  • B 256 characters
  • C 67 characters
  • D It may vary from one operating system to another
Answer: Option D
Q2
According to ANSI specifications which is the correct way of declaring main when it receives command-line arguments?
  • A int main(int argc, char *argv[])
  • B int main(argc, argv) int argc; char *argv;
  • C int main() { int argc; char *argv; }
  • D None of above
Answer: Option A
Q3
What do the 'c' and 'v' in argv stands for?
  • A 'c' means argument control 'v' means argument vector
  • B 'c' means argument count 'v' means argument vertex
  • C 'c' means argument count 'v' means argument vector
  • D 'c' means argument configuration 'v' means argument visibility
Answer: Option C
Q4
Find the output #include "stdio.h" void main ( ) { int x; fopen ("raja.txt","w"); fopen("milu.txt", "w"); x=FOPEN_MAX; printf("%d", x); }
  • A 2
  • B 7
  • C 20
  • D None of these
Answer: Option C
Q5
The files linked and accessed through the library functions are known as
  • A Low level files
  • B Stream oriented files
  • C Library files
  • D None of the above
Answer: Option B
Q6
The files linked and accessed using system calls are known as
  • A Stream oriented files
  • B System oriented files
  • C High level files
  • D None of the above
Answer: Option A
Q7
Find the output #incude "stdio.h" void main () { FILE *p; p=fopen ("raja. txt", "w"); printf("%d", p->fd); }
  • A 5
  • B 6
  • C 7
  • D None of these
Answer: Option A
Q8
What is the content of the file ? #include "stdio.h" void main ( ) { FILE  *p; p=fopen ("letter.txt", "wt"); putc('Go',p); putc ('od',p); rewind(p); putc(Fo',p); putc('Fo',p); fclose(p); }
  • A Food
  • B FoGood
  • C Fo
  • D No output
Answer: Option C
Q9
Which of the following functions is most appropriate for storing numbers in a file ?
  • A putc ( )
  • B fprintf( )
  • C fwrite ( )
  • D None of these
Answer: Option B
Q10
Which of the following is not true about ftell?
  • A it is a function
  • B Gives the current file position indicator.
  • C Can be used to find the size of a file.
  • D it is meant for checking whether a given file exists or not.
Answer: Option D
Questions and Answers for Competitive Exams Various Entrance Test