
quiz on C operator and decision making loop
Quiz by Joyson S
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
- Q1
What is the output of the following code?
8
20
12
0
30s - Q2
What will be the output of the following code?
6
5
Error
4
30s - Q3
What will be the output of the following code?
2 2
2 1
2 0
1 0
30s - Q4
What is the output of the following code?
21
22
23
20
30s - Q5
What is the result of the following code?
10
20
15
50
30s - Q6
Which of the following is NOT a assignment operator?
==
+=
*=
&=
30s - Q7
What is the result of the logical expression (5 > 3) && (2 < 1) in C?
0
1
True
False
30s - Q8
What will be the output of the following code?
-1
0
-5
5
30s - Q9
What is the precedence of arithmetic operators (from highest to lowest)
%, +, /, *, –
%, +, -, *, /
%, *, /, +, –
+, -, %, *, /
30s - Q10
What will be the output?
0
10
20
1
30s - Q11
Which keyword is used to skip the rest of the code inside a loop for the current iteration and start the next iteration?
break
continue
exit
return
30s - Q12
What will be the output of the following code?
1 2 3 4
1 2 3 4 5
1 2 3
1 2
30s - Q13
In which of the following can the break statement NOT be used directly?
do-while
while
if-else
for
30s - Q14
Which of the following loops can be used for infinite looping?
do { } while(1);
All of the above
for(;;)
while(1)
30s - Q15
What will be the output of the following code?
Prints "Hi" infinitely
1
Prints "Hi" once
Error
30s