C-Command Line Arguments Questions and Answers

Practice Mode
Showing 10 of 129 questions
Q11
Find the output #include"stdio.h" void main ( ) { FILE *p; char ch; p=fopen ("raja.txt", "w"); putc (50,p); putc (80, p); putc (70, p); while ((ch=getc(p))!=EOF) putch (ch); fclose (p); }
  • A 508070
  • B 2pf
  • C Compilation error
  • D No output
Answer: Option B
Q12
Which of the following are similar ?
  • A printf ("%d", x) and fprintf (stdin, "%d",x)
  • B scanf("%d",&x) and fscanf (stdout, "%d",&x)
  • C printf ("%d", x) and fprintf(stdout, "%d", x) fprintf (stdout, "%d", x)
  • D None of the above
Answer: Option C
Q13
What is the contents of the file "letter.txt" #include"stdio.h" void main ( ) { FILE *p; char m[ ] = "I \m \the \best"; p=fopen (letter.txt", "w"); fputs (m,p); fclose (p); }
  • A I am the best
  • B I 0m the 0est
  • C i \am \the \best
  • D None of these
Answer: Option B
Q14
On error create ( ) returns
  • A NULL
  • B 1
  • C -1
  • D None of these
Answer: Option C
Q15
The fclose ( ) function
  • A closes only one file at a time
  • B Closes all the files opened
  • C Closes only text file
  • D None of these
Answer: Option A
Q16
The fseek ( ) function
  • A Needs 2 arguments
  • B Makes the rewind function unnecessary
  • C Is meant for checking whether a given file exists or not.
  • D Both b and c
Answer: Option D
Q17
Find the output #include "stdio.h" void main ( ) { FILE *p; printf ("%d %d", stderr->fd, _streams[3].fd); }
  • A 2 3
  • B 4 4
  • C 1 2
  • D Compilation error
Answer: Option A
Q18
How many data members are present in FILE structure ?
  • A 7
  • B 8
  • C 9
  • D 10
Answer: Option C
Q19
MS-WORD is a
  • A ASCII file
  • B Binary file
  • C Bitmap file
  • D None of these
Answer: Option B
Q20
Find the output #include "stdio.h" void main ( ) { FILE *p=0; p++; printf("%d",p); }
  • A 8
  • B 16
  • C Compilation error
  • D None of these
Answer: Option B
Questions and Answers for Competitive Exams Various Entrance Test