Selection Statements

Selection Statements

University

15 Qs

quiz-placeholder

Similar activities

C++ Workshop 2021 [Quiz-2]

C++ Workshop 2021 [Quiz-2]

University

10 Qs

JavaScript CIS14A Quiz 1 Review

JavaScript CIS14A Quiz 1 Review

University

10 Qs

C-Extended

C-Extended

University

16 Qs

Topic 4-2: Multiple if-else and switch-case

Topic 4-2: Multiple if-else and switch-case

University

10 Qs

Weekly Contest #6 - TechXNinjas

Weekly Contest #6 - TechXNinjas

University

10 Qs

C - Flow Control

C - Flow Control

University

20 Qs

Java Questions & Answers

Java Questions & Answers

University

10 Qs

C++ Quiz

C++ Quiz

University

20 Qs

Selection Statements

Selection Statements

Assessment

Quiz

Computers

University

Medium

Created by

MA. PANGALIMAN

Used 19+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following best describes the role of selection statements in C++?

They define loops that execute repeatedly

They allow decision-making based on conditions

They specify the order of function calls in a program

They are only used for handling errors

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following is NOT a selection statement in C++?

if statement

switch statement

for loop

conditional operator ('?:')

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

What will be the output of the following code if `x = 10`?

Greater than 5

Greater than 5 End

End

Compilation error

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following correctly represents a compound if statement?

if (x > 0) cout << "Positive"; cout << "Number";

if (x > 0) { cout << "Positive"; cout << "Number"; }

if x > 0 { cout << "Positive"; cout << "Number"; }

if (x > 0) cout << "Positive", cout << "Number";

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

What will be the output if the user enters `15` in the following code?

Even

Odd

Compilation Error

No output

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which statement correctly implements an if-else structure?

Media Image
Media Image
Media Image
Media Image

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

What is the output if `a = 20` in the following code?

A) A is large

B) A is medium

C) A is small

D) Compilation error

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?