Question 1 of 25
Hints left: 3
Q1
What will be the output of the following C code? #include <stdio.h> int main() { printf("%d\n", srand(9000)); return 0; }
Q2
What will be the output of the following C code? #include <stdio.h> int main() { char *str = "hello, world\n"; printf("%d", strlen(str)); }
Q3
What will be the output of the following C code? scanf(“ %d %d %d”,&n1,&n2);
Q4
What will be the output of the following C code if following commands are used to run (considering myfile exists)? gcc -otest test.c ./test > myfile #include <stdio.h> int main(int argc, char **argv) { char c = 'd'; putchar(c); printf(" %d\n", argc); }
Q5
What will be the output of the following C code? #include <stdio.h> int main() { int i = 10, j = 2; printf("%d\n", printf("%d %d ", i, j)); }
Q6
Which of the following mode argument is used to truncate?
Q7
Which function has a return type as char pointer?
Q8
The following C expression can be substituted for? if (isalpha(c) && isdigit(c))
Q9
A fatal error will be generated if the format string is ended with a white space character.
Q10
What is the return type of rand() function?
Q11
What will be the output of the following C code? #include <stdio.h> int main() { FILE *fp = stdout; int n; fprintf(fp, "%d ", 45); fprintf(stderr, "%d ", 65); return 0; }
Q12
putchar(c) function/macro always outputs character c to the . . . . . . . .
Q13
Which is not true about function tolower?
Q14
What will be the output of the following C code? #include <stdio.h> #include <stdlib.h> int main() { printf("%d\n", rand() % 1000); return 0; }
Q15
A conversion specification %7.4f means . . . . . . . .
Q16
What will the given code result is printf("\n you are\awesome \" """");"""
Q17
puts() function adds newline character.
Q18
If the mode includes b after the initial letter, what does it indicates?
Q19
What is the meaning of the following C statement? scanf("%[^\n]s", ch);
Q20
What does tmpfile() returns when it could not create the file?
Q21
What are the Properties of the first argument of a printf() functions?
Q22
What will be the output of the following C code? #include <stdio.h> #include <stdarg.h> int f(char c, ...); int main() { char c = 97, d = 98; f(c, d); return 0; } int f(char c, ...) { va_list li; va_start(li, c); char d = va_arg(li, char); printf("%c\n", d); va_end(li); }
Q23
What does the following command line signify? prog1|prog2
Q24
What will be the output of the following C code? #include <stdio.h> int main() { int n; scanf("%d", &n); ungetc(n, stdin); scanf("%d", &n); printf("%d\n", n); return 0; }
Q25
The . . . . . . . . function reads atmost one less than the number of characters specified by size from the given stream and it is stored in the string str.