Which of the following is the correct syntax for the ternary operator in C?
C Programming Quiz(session2)

Quiz
•
Computers
•
10th Grade
•
Medium
Sumithra pm
Used 2+ times
FREE Resource
21 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
if ? else :
condition ? true_value : false_value;
? condition : true_value;
if (condition) ? true : false;
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code? int a = 10; if (a > 5) printf("A"); else printf("B");
A
B
Nothing
Error
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which loop guarantees at least one execution of the loop body?
for
while
do...while
if
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which control statement is best suited for multiple constant-value selections?
if
else if
switch
while
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will the following code print? int i; for (i = 1; i 0) ? printf("Positive") : printf("Negative");
Positive
Negative
Error
Nothing
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is not a valid keyword in C for control statements?
if
switch
select
else
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
The default keyword is used in which control structure?
if
else if
switch
while
Create a free account and access millions of resources
Similar Resources on Quizizz
20 questions
Basic Python

Quiz
•
10th - 12th Grade
20 questions
Lenguaje C

Quiz
•
10th Grade
20 questions
Chapter 5 loops structure

Quiz
•
10th Grade
20 questions
Debugging

Quiz
•
10th Grade
20 questions
Python variables and operators quiz

Quiz
•
9th - 12th Grade
25 questions
Java Review

Quiz
•
9th Grade - University
20 questions
Pemrograman Dasar Kelas X

Quiz
•
10th Grade
20 questions
Java Conditional Constructs

Quiz
•
9th - 10th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University