Ace
Learns
Theme
light_mode
dark_mode
light_mode
Light
dark_mode
Dark
monitor
Auto
Open main menu
menu_open
×
Home
History
Geography
Astronomy
Physics
Chemistry
Biology
Agriculture
Sports
Computer Science
Articles
Contact Us
MCQ Categories
Articles
Home
Contact Us
Home
»
Computer Science
»
Programming in C
»
Operators in C
Programming in C
unfold_more
double_arrow
Data Types in C
double_arrow
Operators in C
quiz
Operators in C
1.
What will be the output of the following C program?
#include <stdio.h> int main() { char charArray[10]; printf("Size of char array: %d bytes\n", sizeof(charArray)); return 0; }
A)
1
B)
10
C)
Compile-time error
D)
0
Answer
keyboard_arrow_down
keyboard_arrow_up
B) 10
Explanation
2.
What is the output of the following code?
int x = 5, y = 3; printf("%d\n", x++ + y);
A)
8
B)
9
C)
10
D)
7
Answer
keyboard_arrow_down
keyboard_arrow_up
A) 8
Explanation
3.
What is the value of x after the following code runs?
#include <stdio.h> int main() { int x = 5; x *= 2 + 3; printf("%d",x); return 0; }
A)
25
B)
10
C)
15
D)
13
Answer
keyboard_arrow_down
keyboard_arrow_up
A) 25
Explanation
4.
Which operator in C is used to access the address of a variable?
A)
*
B)
&
C)
^
D)
->
Answer
keyboard_arrow_down
keyboard_arrow_up
B) &
Explanation
5.
What is the result of the following C program?
#include <stdio.h> int main() {int x = 2, y = 10, z = -4;int result = x == z || y > x; printf("Result: %d\n", result); return 0;}
A)
Result: 0
B)
Result: 1
C)
Result: True
D)
Result: False
Answer
keyboard_arrow_down
keyboard_arrow_up
B) Result: 1
Explanation
6.
How many operands does the ternary conditional operator require in C?
A)
1
B)
2
C)
3
D)
4
Answer
keyboard_arrow_down
keyboard_arrow_up
C) 3
Explanation
7.
What is the output of the expression 10 << 2 in C?
A)
20
B)
30
C)
40
D)
100
Answer
keyboard_arrow_down
keyboard_arrow_up
C) 40
Explanation
8.
What does the ! operator do in C?
A)
Performs logical OR
B)
Performs logical AND
C)
Performs bitwise AND
D)
Performs logical NOT
Answer
keyboard_arrow_down
keyboard_arrow_up
D) Performs logical NOT
Explanation
Quick Links
Biology
chevron_right
Essential Nutrients
chevron_right
Organs of the Human Body
chevron_right
Plants
chevron_right
Human Diseases
History
chevron_right
Ancient Civilizations
chevron_right
Revolution and Counter-Revolution
chevron_right
Industrialization
chevron_right
Medieval World History
Current Affairs & Events
chevron_right
Daily Current Affairs
chevron_right
Latest Current Events
Astronomy
chevron_right
The Universe
chevron_right
Galaxies
chevron_right
Stars
chevron_right
Space Exploration