
C Programming Unit 2 Quiz
Authored by H Thangkhanhau
Computers
Professional Development
Used 20+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the if statement in C do?
Declares variables
Repeats a block of code
Evaluates a condition and executes a block if it’s true
Defines a function
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In C, which value is treated as FALSE in conditional expressions?
1
-1
NULL
All non-zero values
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements is used to jump to a label?
break
continue
switch
goto
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is true about the switch statement?
It can compare float values
It requires default case
It uses integral or enumerated types
It cannot have break statements
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the continue statement?
Exit the loop immediately
Skip the current iteration
Exit the program
Pause the program
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which loop will definitely execute at least once?
while
for
do...while
None of the above
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If int a = 5; then what will be the output of int b = (a == 5) ? 3 : 2; ?
5
3
2
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 Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?