1. Which of the following cannot be a variable name in C?
a) volatile
b) true
c) friend
d) export
2. Which keyword is used to prevent any changes in the variable within a C program?
a) immutable
b) mutable
c) const
d) volatile
3. The C-preprocessors are specified with _________ symbol.
a) #
b) $
c) ” ”
d) &
4. In C language, FILE is of which data type?
a) int
b) char *
c) struct
d) None of the mentioned
5. What is the sizeof(char) in a 32-bit C compiler?
a) 1 bit
b) 2 bits
c) 1 Byte
d) 2 Bytes
6. What will be the output of the following C code on a 64 bit machine?
1. #include <stdio.h>
2. union Sti
3. {
4. int nu;
5. char m;
6. };
7. int main()
8. {
9. union Sti s;
10. printf("%d", sizeof(s));
11. return 0;
12. }
a) 8
b) 5
c) 9
d) 4
7. What will be the final value of x in the following C code?
1. #include <stdio.h>
2. void main()
3. {
4. int x = 5 * 9 / 3 + 9;
5. }
a) 3.75
b) Depends on compiler
c) 24
d) 3
8. Comment on the following C statement.
n = 1;
printf("%d, %dn", 3*n, n++);
a) Output will be 3, 2
b) Output will be 3, 1
c) Output will be 6, 1
d) Output is compiler dependent
9. What will be the data type returned for the following C function?
1. #include <stdio.h>
2. int func()
3. {
4. return (double)(char)5.0;
5. }
a) char
b) int
c) double
d) multiple type-casting in return is illegal
10. Which option should be selected to work the following C expression?
string p = "HELLO";
a) typedef char [] string;
b) typedef char *string;
c) typedef char [] string; and typedef char *string;
d) Such expression cannot be generated in C