IF Statements and Loops in C++

Quiz
•
Computers
•
10th Grade
•
Medium
Heribertus Istiyanto
Used 19+ times
FREE Resource
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
Similar Resources on Wayground
25 questions
Registers and RAM

Quiz
•
9th - 12th Grade
25 questions
Python Conditional Statements

Quiz
•
9th - 12th Grade
30 questions
DCS - Final Exam Review

Quiz
•
9th - 12th Grade
30 questions
Introduction to Problem Solving and Algorithms

Quiz
•
10th - 12th Grade
30 questions
Soal Ulangan Pemograman Web dan Perangkat Bergerak Kelas XI (11) RPL

Quiz
•
9th - 12th Grade
30 questions
Python 4 topic (циклы)

Quiz
•
6th - 12th Grade
27 questions
Python Loops

Quiz
•
9th - 12th Grade
29 questions
JavaScript

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

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

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
1.2 OSI & TCP IP Models Quiz

Quiz
•
10th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
20 questions
Hardware vs. Software Quiz

Quiz
•
7th - 10th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade