IF Statements and Loops in C++

IF Statements and Loops in C++

10th Grade

30 Qs

quiz-placeholder

Similar activities

J2 - Review for Exam- Loops and if Statements

J2 - Review for Exam- Loops and if Statements

9th - 12th Grade

27 Qs

IF X

IF X

10th Grade

25 Qs

ASESMEN TENGAH SEMESTER INFORMATIKA KELAS X - SMKN 52 JAKARTA

ASESMEN TENGAH SEMESTER INFORMATIKA KELAS X - SMKN 52 JAKARTA

10th Grade

30 Qs

Homework 06/12/2021

Homework 06/12/2021

7th - 11th Grade

25 Qs

Algorithms - python (GCSE)

Algorithms - python (GCSE)

10th - 12th Grade

25 Qs

WJEC CS 1.1, 1.2, 1.4, 1.8, 2.3.1 and 2.3.3 Part 5

WJEC CS 1.1, 1.2, 1.4, 1.8, 2.3.1 and 2.3.3 Part 5

9th - 10th Grade

28 Qs

Python Conditionals Review

Python Conditionals Review

9th - 12th Grade

31 Qs

Program Development - Python: Loops

Program Development - Python: Loops

9th - 10th Grade

26 Qs

IF Statements and Loops in C++

IF Statements and Loops in C++

Assessment

Quiz

Computers

10th Grade

Medium

Created by

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?