
C Quiz - Variables & Operators
Authored by Jenefa Engineering
Computers
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the size of the int data type in C on most modern systems?
2 bytes
4 bytes
8 bytes
It depends on the compiler
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is not a valid variable name in C?
int _a8;
int a8;
int 8a;
int _8a;
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
int x = 5;
printf("%d", x++);
5
6
4
Error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the const keyword in C?
To declare a variable constant
To define a constant value
Both A and B
Neither A nor B
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In C, what does the sizeof operator return?
The size of a variable in bits
The size of a variable in bytes
The total number of bits in the system
The number of elements in an array
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following operators is used for logical AND in C?
&
&&
|
||
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
int a = 10, b = 20;
printf("%d", a > b ? a : b);
10
20
30
Error
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Microsoft
or continue with
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?