
C Programming: if-then-else Quiz

Quiz
•
Computers
•
12th Grade
•
Hard
joel borah
Used 1+ times
FREE Resource
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Explain the use of else if statement in C programming.
It is used to declare a variable in C programming
It is used to end the program in C programming
It is used to repeat a block of code in C programming
It is used to check multiple conditions and execute a different block of code for each condition.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the conditional operator in C?
To make a decision based on a condition
To define functions
To create loops
To perform mathematical calculations
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is my result?
mickey = mouse .
if mickey == mouse: .
. print("Mickey is a mouse")
.else: .
. print("Minnie rules") .
'Mickey is a mouse"
"Minnie Rules"
Nothing is printed
"Mickey is a mouse and Minnie rules"
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is my result?
john = 6 .
if john != 6: .
. print("John is getting ice cream")
else: .
. print("John is getting apple juice")
. print("John is getting grapes")
John is getting ice cream
John is getting grape
John is getting apple juice
John is getting apple juice
John is getting grapes
John is getting ice cream
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is an "ELSE" statement?
Assigns a value to a variable
Adds another command the code will execute
A function that is performed if the "if" statement is not satisfied
Runs the statement coded if anything else in the code does not run as anticipated.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are the conditional operators used in if-else statements in C programming?
print, scan, loop
+, -, *, /
==, !=, >, <, >=, <=
&&, ||, !
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you use the '==' operator in an if-else statement in C?
To compare two values for equality in a conditional statement.
To check if a variable is initialized in an if-else statement
To perform addition in an if-else statement
To print a message in an if-else statement
8.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you write an if-else statement with multiple conditions in C?
Separate each condition with a comma in the if-else statement in C.
Use the 'end if' keyword to add multiple conditions in an if-else statement in C.
Use the 'else if' keyword to add multiple conditions in an if-else statement in C.
Similar Resources on Wayground
10 questions
ครอบครัวของ if

Quiz
•
9th - 12th Grade
10 questions
Evaluasi Percabangan

Quiz
•
12th Grade
10 questions
SIK Lessons 3-9

Quiz
•
9th - 12th Grade
9 questions
Javascript - պայմանի օպերատորներ

Quiz
•
12th Grade
11 questions
Python Projects Quiz

Quiz
•
6th Grade - University
11 questions
Python Boolean

Quiz
•
11th - 12th Grade
11 questions
JavaScript Control Structures Basic

Quiz
•
12th Grade
10 questions
CS1310 Unit 1 Quizziz

Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade