C Programming: MCQ Set – 04
C Programming: MCQ Set – 04
by
codecrucks
·
Published
· Updated
Q31: The << operator is used for
- (A) Right shifting
- (B) Right shifting
- (C) Bitwise shifting
- (D) Bitwise complement
Q32: In addition to communicating with I/O, the processor must communicate with the ______________ unit.
- (A) Control
- (B) Memory
- (C) Arithmetic
- (D) Process
Q33: Which of the following is FALSE in C
- (A) Keywords can be used as variable names
- (B) Variable names can contain a digit
- (C) Variable names do not contain a blank space
- (D) Capital letters can be used in variable names
Q34: If an array is used as function argument, the array is passed
- (A) By value
- (B) By reference
- (C) By name
- (D) The array cannot be used as a function argument
Q35: What is the output of following code?
printf(“%c”, 100);
- (A) prints 100
- (B) prints ASCII equivalent of 100
- (C) prints garbage
- (D) None of the above
Q36: Portable program means
- (A) Program with wheels
- (B) Independent from its authors
- (C) Independent of platform
- (D) None of the above
Q37: Output of the following program fragment is
x = 5;
y = x++;
printf(“%d%d”, x, y);
- (A) 5, 6
- (B) 5, 5
- (C) 6, 5
- (D) 6, 6
Q38: What will happen if the following loop is executed?
int num = 0;
do
{
--num;
printf(“%d”, num);
num++;
}while (num >= 0);
}
- (A) The loop will run infinite number of times.
- (B) The program will not enter the loop.
- (C) There will be a compilation error.
- (D) There will be runtime error.
Q39: The directive that can be used to test whether an expression evaluates to a nonzero value or not is
- (A) #if
- (B) #elif
- (C) #endif
- (D) #exit
Q40: Which of the following does not represent a valid storage class in ’c’?
- (A) automatic
- (B) static
- (C) union
- (D) extern
Answer:
Question | Q31 | Q32 | Q33 | Q34 | Q35 | Q36 | Q37 | Q38 | Q39 | Q40 |
Answer | B | B | A | B | B | C | C | C | A | C |