
Q91
Q91 Which operator has higher precedence, '+' or '*'?
*
Both are same
=+
None
Q92
Q92 What is the output of the expression 2<3?
0
1
2
3
Q93
Q93 Pseudocode:
SET a TO 10, b TO 20 PRINT a PLUS b
30
20
10
0
Q94
Q94 Pseudocode:
SET value TO 10 PRINT NOT value
-10
0
1
10
Q95
Q95 Pseudocode:
SET x TO 5 IF x GREATER THAN 0 AND x LESS THAN 10 THEN PRINT "x is between 0 and 10"
Prints "x is between 0 and 10"
Prints nothing
Syntax error
Prints "x is not between 0 and 10"
Q96
Q96 Identify the mistake:
int main() {
int x = 10, y; y = x == 10 ? x : 0;
printf("%d", y);
return 0;
}
Incorrect use of ternary operator
Syntax error
No error
Wrong variable used
Q97
Q97 What is the difference between for and while loops?
Syntax
Execution speed
Functionality
No difference
Q98
Q98 What is the output of the following C code?
int main() {
int x = 0; do {
printf("%d ", x);
x++;
} while(x < 3);
return 0;
}
0 1 2
0 1
1 2 3
No output
Q99
Q99 Pseudocode:
SET count TO 0 REPEAT PRINT count INCREMENT count UNTIL count EQUALS 3
Prints 0 1 2 3
Prints 0 1 2
Prints 3
Syntax error
Q100
Q100 Pseudocode:
SET i TO 0 WHILE i LESS THAN 10 IF i MOD 2 EQUALS 0 THEN CONTINUE INCREMENT i PRINT i END WHILE
Prints odd numbers from 1 to 9
Prints even numbers from 0 to 8
Prints all numbers from 0 to 9
Syntax error
Q101
Q101 Spot the mistake:
int main() {
for(int i = 0; i < 5; i++) {
if(i == 2)
continue;
printf("%d ", i);
} return 0;
}
Infinite loop
Skips printing 2
Syntax error
No error
Q102
Q102 What does 'pass by value' mean in C?
Passing a copy of the argument
Passing the argument directly
Passing the memory address
Passing the variable type
Q103
Q103 What is the scope of a local variable in C?
Inside the function in which it is declared
Throughout the program
Inside the file
Throughout the function block where it is declared
Q104
Q104 What will be the output of the following C code?
int main() {
int num = 10;
increment(num);
printf("%d", num);
return 0;
} void increment(int n) {
n++;
}
10
11
Error
Nothing
Q105
Q105 What is the output of this recursive function call?
int main() {
printf("%d ", factorial(5));
return 0;
}
int factorial(int n) {
if (n==0)
return 1;
else
return n * factorial(n - 1);
}
120
24
5
Error
Q106
Q106 Pseudocode:
FUNCTION CheckEven(number) IF number MOD 2 EQUALS 0 THEN RETURN True ELSE RETURN False END FUNCTION CALL CheckEven(4)
True
False
Error
None
Q107
Q107 Pseudocode:
FUNCTION Fibonacci(n) IF n LESS THAN OR EQUAL TO 1 THEN RETURN n ELSE RETURN Fibonacci(n-1) PLUS Fibonacci(n-2) END FUNCTION CALL Fibonacci(5)
5
8
Error
None
Q108
Q108 Identify the error in this C code:
int main() {
printHello();
return 0;
}
void printHello() {
printf("Hello");
}
Missing declaration of printHello
Syntax error
No error
Wrong function call
Q109
Q109 Find the error:
int main() {
int x = 5;
increment(&x);
printf("%d", x);
return 0;
}
void increment(int* n) {
*n++;
}
Incorrect pointer usage in increment
Syntax error
No error
Wrong printf format
Q110
Q110 Which index is used to access the first element of an array in C?
0
1
-1
First
Q111
Q111 How do you initialize an array in C?
With any value
With 0s
With 1s
Cannot be initialized
Q112
Q112 Which of the following is a correct way to pass an array to a function in C?
By specifying the size of the array
By passing the first element
By passing the array name
By passing each element individually
Q113
Q113 How can you access the third element in the second row of a 2D array int arr[3][4]; in C?
arr[1][2]
arr[2][3]
arr[3][2]
arr[2][1]
Q114
Q114 How does C handle array index out of bounds errors during runtime?
Generates a compile-time error
Automatically corrects the index
Generates a runtime error
Does not check for bounds
Q115
Q115 Complete the C code:
int main() {
int arr[5];
for(int i = 0; i < 5; i++) { ___ }
printf("%d", arr[2]);
return 0;
}
arr[i] = i;
arr[i] = i * 2;
arr[i] = i + 1;
arr[i] = 0;
Q116
Q116 Pseudocode:
ARRAY arr[10] FOR i FROM 0 TO 9 SET arr[i] TO i TIMES 2 END FOR PRINT arr[6]
Prints 6
Prints 12
Prints 7
Syntax error
Q117
Q117 Pseudocode:
ARRAY matrix[2][3] SET matrix[0][0] TO 1, matrix[0][1] TO 2, matrix[0][2] TO 3, matrix[1][0] TO 4, matrix[1][1] TO 5, matrix[1][2] TO 6 PRINT matrix[1][2]
Prints 1
Prints 5
Prints 6
Syntax error
Q118
Q118 Find the mistake:
int main() {
int arr[5] = {1, 2, 3, 4, 5};
for(int i = 0; i <= 5; i++) {
printf("%d ", arr[i]);
}
return 0;
}
Off-by-one error in loop bounds
Syntax error
No error
Incorrect array initialization
Q119
Q119 What is the output of sizeof(pointer) where pointer is an integer pointer in C?
4 on all systems
8 on all systems
Depends on the system architecture
Depends on the compiler
Q120
Q120 What does passing a pointer to a function allow the function to do?
Read the value of the variable
Change the value of the variable
Copy the variable
None of the above


