C-Command Line Arguments Questions and Answers

Practice Mode
Showing 10 of 129 questions
Q31
fclose () function can
  • A Closes the stream
  • B Flushes all unwritten data from the stream.
  • C Discard all unread buffered input and free all allocated buffer.
  • D All of the above
Answer: Option D
Q32
If an error occurs during closing of a file then fclose () returns
  • A EOF
  • B Zero
  • C File pointer
  • D None of these
Answer: Option B
Q33
File I/O functions
  • A Contains functions to receive input from KB and write output to VDU.
  • B Contains functions to perform I/O operations on hard disk.
  • C Contains functions similalr to all operating system.
  • D All of the above
Answer: Option A
Q34
Find the output #include "stdio.h" void main ( ) { int i=5; char x='x'; float y=3.9; char str[20]; sprint(str,"%d %c %f",i,x,y); printf("%s",str); }
  • A x
  • B 5 x 3.9
  • C 5 x 3.90000
  • D Compilation error
Answer: Option C
Q35
The commonly used functions for writing to a text stream are
  • A putc( )
  • B fputc( )
  • C fputs( )
  • D All of the above
Answer: Option D
Q36
in UNIX, file protection can be assigned at
  • A user level
  • B Group level
  • C Other
  • D All of the above
Answer: Option D
Q37
The sector size of a disk working in MS DOS envoronment is
  • A 512 bytes
  • B 256 bytes
  • C 1024 bytes
  • D None of these
Answer: Option A
Q38
The function read ( ) returns
  • A Actual number of bytes transferredon successful reading
  • B -1 if an EOF is found
  • C 0 if an error occurs.
  • D All of the above
Answer: Option A
Q39
Find out the output #include "fcnt1.h" #include"sys\stat.h" void main ( ) { int x; x=open ("raja.txt", 0_CREAT | _TEXT, S_TWRITE); printf ("%d", k); }
  • A 5
  • B 6
  • C 7
  • D None of these
Answer: Option C
Q40
State the correct statement.
  • A fseek() only works with file handler
  • B Iseek() only works with file pointer
  • C close() closes the file pointer
  • D None of these
Answer: Option D
Questions and Answers for Competitive Exams Various Entrance Test