C-Command Line Arguments Questions and Answers
Practice ModeShowing 10 of 129 questions
Q41
State the correct statement
Answer: Option D
Q42
fclose () don't flush any unwritten data for the associated file.
Answer: Option B
Q43
Find the output
#include"stdio.h"
void main ( )
{
FILE *p;
char *ch;
ch="Welcome to puri";
p=fopen(raja.txt",'w");
fprintf(p, "%s",ch);
fclose(p);
p=fopen("raja.txt","r");
fflush(p);
fscanf(p,"%s",ch);
printf("%s",ch);
}
Answer: Option A
Q44
If the file name is aaa and type from the command prompt aaa xxx yyy zzz then the following program prints xxx yyy and zzz. Which of the following option is true.
#jinclude <stdio.h>
int main (int argc, char *argv[])
{
int x;
printf(%d\n", argc);
for (x=; x<argc; x++)
printf(%s\n", argv[x]);
return 0;
}
Answer: Option B
Q45
Tthe contents of a file will be lost if it is opened in
Answer: Option C
Q46
Which of the following command is used to access file randomly ?
Answer: Option B
Q47
A stream can be thougght of as
Answer: Option D
Q48
State the correct statement.
Answer: Option D
Q49
The function ftell(fp) returns
Answer: Option C
Q50
The function ftell(fp) returns
Answer: Option C