Question 1 of 25
Hints left: 3
Q1
What will be the output of the following C code? #include <stdio.h> #include <math.h> void main() { int k = fabs(-87); printf("%d\n", k); }
Q2
gets() function checks overflow run.
Q3
Which is true about isaplpha(c), where c is an int that can be represented as an unsigned? char or EOF.isalpha(c) returns
Q4
What will be the output of the following C code considering user typed jkl? #include <stdio.h> int main() { char n[20]; fgets(n, 19, stdin); ungetc(n[0], stdin); printf("%s\n", n); return 0; }
Q5
In linux, apart from including math header file, the program is successfully executed by which of the following?
Q6
For the function call time(), what type of parameter is accepted?
Q7
The syntax of the scanf() is scanf("control string ", arg1,arg2,arg3,....,argn); the prototype of control string is
Q8
The syntax to print a % using printf statement can be done by . . . . . . . .
Q9
Which of the following is NOT a delimiter for an input in scanf?
Q10
Which is true about isupper(c), where c is an int that can be represented as an unsigned? char or EOF.isupper(c) returns
Q11
Memory allocation using malloc() is done in . . . . . . . .
Q12
The parameter control string in the printf () is a C String that contains text to be . . . . . . . .
Q13
Output justification such as decimal point, numerical sign, trailing zeros or octal are specified.
Q14
What is the purpose of sprintf?
Q15
What will be the output of the following C code? #include <stdio.h> #include <math.h> int main() { int i = 10; printf("%f\n", log10(i)); return 0; }
Q16
function fabs defined math.h header file takes the argument of type integer.
Q17
What will be the output of the following C code? #include <stdio.h> #include <stdlib.h> int main() { srand(9000); printf("%d\n", rand()); return 0; }
Q18
The conversion characters d, i, o, u, and x may be preceded by h in scanf() to indicate?
Q19
What is meant by 'a' in the following C operation? fp = fopen("Random.txt", "a");
Q20
Which of the following is the correct declaration for ungetc?
Q21
fwrite() can be used only with files that are opened in binary mode.
Q22
What will be the output of the following C code? #include <stdio.h> int main() { char i = '9'; if (isdigit(i)) printf("digit\n"); else printf("not digit\n"); return 0; }
Q23
What will be the output of the following C code? #include <stdio.h> #include <stdlib.h> int main() { FILE *fp = stdout; int n; fprintf(fp, "%d", 45); }
Q24
What will be the output of the following C code? printf(“\n Output: %5d \t %x \t %#x”, 234,234,234);
Q25
Which among the following is the odd one out?