Question 1 of 25
Hints left: 3
Q1
What are the first and second arguments of fopen?
Q2
What will be the output of the following C code? #include <stdio.h> int main(int argc, char **argv) { char *s = "myworld"; int i = 3; printf("%10.*s", i, s); }
Q3
What will fopen will return, if there is any error while opening a file?
Q4
Control string specifies the type and format of the data that has to be obtained from the keyboard.
Q5
In a variable length argument function, the declaration "..." can . . . . . . . .
Q6
What will be the output of the following C code? #include <stdio.h> int main() { char buf[12]; stderr = stdin; fscanf(stderr, "%s", buf); printf("%s\n", buf); }
Q7
The syntax of printf() function is printf("control string", variable list) ;what is the prototype of the control string?
Q8
ungetc() can be used only with getc().
Q9
calloc() returns storage that is initialized to.
Q10
Which of the following statement is true?
Q11
Within main, return expr statement is equivalent to . . . . . . . .
Q12
Which of the following fopen() statements are illegal?
Q13
What will be the output of the following C code? #include <stdio.h> int main() { int i = 10, j = 3; printf("%d %d %d", i, j); }
Q14
What is the syntax of ungetc()?
Q15
What will be the output of the following C code? #include <stdio.h> int main() { FILE *fp = stdout; int n; fprintf(fp, "%d\n ", 45); fprintf(stderr, "%d ", 65); return 0; }
Q16
What will be the output of the following C code? #include <stdio.h> int main() { srand(time(NULL)); printf("%d\n", rand()); return 0; }
Q17
What will be the output of the following C code? char str[] = "Hello Nancy“; printf(“\n %.7s”, str) ;
Q18
fflush(NULL) flushes all . . . . . . . .
Q19
What form the data must be entered for the given C code? scanf(“%d / %d”, &n1,&n2);
Q20
What will be the output of the following C code? #include <stdio.h> #include <string.h> int main() { char line[3]; FILE *fp; fp = fopen("newfile.txt", "r"); while (fgets(line, 3, fp)) fputs(line, stdout); return 0; }
Q21
Which of the following is the right declaration for fgets() inside the library?
Q22
What will be the output of the following C code? #include <stdio.h> int main() { short int i; scanf("%*hd", &i); printf("%hd", i); return 0; }
Q23
puts() does the following when it writes to stdout.
Q24
What will be the output of the following C code? #include <stdio.h> int main() { short int i; scanf("%hd", &i); printf("%hd", i); return 0; }
Q25
What will be the output of the following C code? #include <stdio.h> int main() { char *n; scanf("%s", n); return 0; }