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