Quiz - 8 on conditional/ternary operator
Quiz
•
others
•
•
Medium
Michael Kona
Used 3+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the value of x after the following code is executed?
int x = (5 > 3) ? 10 : 20;
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the value of y after the following code is executed?
int y = (5 < 3) ? 10 : 20;
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following code print?
int a = 1, b = 2;
printf("%d", (a > b) ? a : b);
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the value of result after the following code is executed?
int x = 4;
int result = (x % 2 == 0) ? x * 2 : x * 3;
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following code print?
int a = 3, b = 5;
printf("%d", (a == b) ? 100 : 200);
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the value of z after the following code is executed?
int x = 10, y = 20;
int z = (x > y) ? x : y;
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following code print?
int a = 7;
printf("%s", (a % 2 == 0) ? "even" : "odd");
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
Vocabulary Comprehension
Quiz
•
12th Grade
10 questions
Ejercicio Corto #1
Quiz
•
KG - University
12 questions
Evaluación Diagnostica - Informática Básica
Quiz
•
KG - University
10 questions
TO BE/HAVE/WEAR
Quiz
•
KG - University
20 questions
LEY EDUCATIVA 070
Quiz
•
KG - University
10 questions
QUIZ MS WORD
Quiz
•
KG - University
15 questions
Introduction à la trigonométrie (cours #1)
Quiz
•
KG - University
10 questions
DSD QUIZZ 2 2023 Batch
Quiz
•
KG - University
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
6 questions
FOREST Self-Discipline
Lesson
•
1st - 5th Grade
7 questions
Veteran's Day
Interactive video
•
3rd Grade
20 questions
Weekly Prefix check #2
Quiz
•
4th - 7th Grade
Discover more resources for others
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
6 questions
FOREST Self-Discipline
Lesson
•
1st - 5th Grade
7 questions
Veteran's Day
Interactive video
•
3rd Grade
20 questions
Weekly Prefix check #2
Quiz
•
4th - 7th Grade
