IF Statements and Loops in C++
Quiz
•
Computers
•
10th Grade
•
Practice Problem
•
Medium
Heribertus Istiyanto
Used 19+ times
FREE Resource
Enhance your content in a minute
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What is the output of the following code: if (5 > 3) { cout << 'True'; }?
Not Sure
Maybe
True
False
2.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which of the following is the correct syntax for an IF statement in C++?
if (condition) // code to execute }
if condition { // code to execute }
if { condition } // code to execute
if (condition) { // code to execute }
3.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What will be the output of the following code: if (x < 10) { cout << 'Less'; } else { cout << 'More'; } when x = 15?
More
Undefined
Less
Equal
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
In a nested IF statement, what happens if the first condition is false?
The program terminates immediately.
The first condition is skipped entirely.
The first condition is re-evaluated.
The next condition is evaluated.
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which logical operator represents 'AND' in C++?
&&
!
||
&
6.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What is the purpose of the ELSE statement in an IF-ELSE structure?
The ELSE statement is used to define a loop structure.
The ELSE statement allows for alternative execution when the IF condition is false.
The ELSE statement is only executed if the IF condition is true.
The ELSE statement is used to terminate the program.
7.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What will be the output of the following code: if (a == 5 && b == 10) { cout << 'Yes'; } else { cout << 'No'; } when a = 5 and b = 10?
Yes
Absolutely not
Maybe
No
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
Already have an account?
Similar Resources on Wayground
30 questions
TIK dan Informatika Kelas 10 (UH-1)
Quiz
•
10th Grade
25 questions
EXCEL QUIZ-01
Quiz
•
9th - 10th Grade
25 questions
Unit 2 - Turtle Graphics Quiz for Python Computer Programming I
Quiz
•
9th - 12th Grade
25 questions
security+ (601)
Quiz
•
9th Grade - Professio...
30 questions
Programming Techniques
Quiz
•
8th - 10th Grade
25 questions
C++ (Part 1)
Quiz
•
10th Grade
25 questions
quiz tjkt
Quiz
•
10th Grade
25 questions
CPA Inkscape Quiz 01
Quiz
•
7th - 12th Grade
Popular Resources on Wayground
10 questions
Forest Self-Management
Lesson
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
30 questions
Thanksgiving Trivia
Quiz
•
9th - 12th Grade
30 questions
Thanksgiving Trivia
Quiz
•
6th Grade
11 questions
Would You Rather - Thanksgiving
Lesson
•
KG - 12th Grade
48 questions
The Eagle Way
Quiz
•
6th Grade
10 questions
Identifying equations
Quiz
•
KG - University
10 questions
Thanksgiving
Lesson
•
5th - 7th Grade
Discover more resources for Computers
30 questions
Thanksgiving Trivia
Quiz
•
9th - 12th Grade
11 questions
Would You Rather - Thanksgiving
Lesson
•
KG - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University
18 questions
Thanksgiving Trivia
Quiz
•
4th - 12th Grade
20 questions
Thanksgiving
Quiz
•
KG - 12th Grade
10 questions
Understanding Meiosis
Interactive video
•
6th - 10th Grade
10 questions
Thanksgiving Trivia Challenge: Test Your Knowledge!
Interactive video
•
6th - 10th Grade
28 questions
Ser vs estar
Quiz
•
9th - 12th Grade
