C-Command Line Arguments

C-Command Line Arguments
11. 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);
}


  • 508070
  • 2pf
  • Compilation error
  • No output
Show Answer
12. Which of the following are similar ?
  • printf ("%d", x) and fprintf (stdin, "%d",x)
  • scanf("%d",&x) and fscanf (stdout, "%d",&x)
  • printf ("%d", x) and fprintf(stdout, "%d", x) fprintf (stdout, "%d", x)
  • None of the above
Show Answer
13. 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);
}

  • I am the best
  • I 0m the 0est
  • i \am \the \best
  • None of these
Show Answer
14. On error create ( ) returns

  • NULL
  • 1
  • -1
  • None of these
Show Answer
15. The fclose ( ) function
  • closes only one file at a time
  • Closes all the files opened
  • Closes only text file
  • None of these
Show Answer
16. The fseek ( ) function
  • Needs 2 arguments
  • Makes the rewind function unnecessary
  • Is meant for checking whether a given file exists or not.
  • Both b and c
Show Answer
17. Find the output
#include "stdio.h"
void main ( )
{
FILE *p;
printf ("%d %d", stderr->fd, _streams[3].fd);
}

  • 2 3
  • 4 4
  • 1 2
  • Compilation error
Show Answer
18. How many data members are present in FILE structure ?
  • 7
  • 8
  • 9
  • 10
Show Answer
19. MS-WORD is a
  • ASCII file
  • Binary file
  • Bitmap file
  • None of these
Show Answer
20. Find the output
#include "stdio.h"
void main ( )
{
FILE *p=0;
p++;
printf("%d",p);
}

  • 8
  • 16
  • Compilation error
  • None of these
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test