Topic2: If method

Topic2: If method

University

10 Qs

quiz-placeholder

Similar activities

Chapter 2: Input Device

Chapter 2: Input Device

12th Grade - University

12 Qs

HTML Quiz

HTML Quiz

11th Grade - University

15 Qs

Hệ Điều Hành Của Máy Tính

Hệ Điều Hành Của Máy Tính

10th Grade - University

10 Qs

quiz pertemuan 2 asik ddp

quiz pertemuan 2 asik ddp

University

15 Qs

QUIZ 1: REVIEW ON C

QUIZ 1: REVIEW ON C

University

15 Qs

Software Testing

Software Testing

University

10 Qs

EC335 - Quiz 1

EC335 - Quiz 1

University

10 Qs

Topic2: If method

Topic2: If method

Assessment

Quiz

Computers

University

Practice Problem

Easy

Created by

AZLINA MYDIN

Used 7+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following program segment?

int num=10;

if (num >5)

{ cout<< "Number is greater than 5"; }

Number is greater than 5

Number is not greater than 5

10

5

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following program segment?

int num=10;

if (num >20)

cout<< "Number is greater than 20";

else

cout<< "Number is less than 20";

Number is greater than 20

Number is less than 20

10

5

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following program segment?

int num=10;

if (num >0)

cout<< "Number is greater than 0";

else

cout<< "Number is less than 0";

cout<<"\ntq";

Number is greater than 0

tq

Number is less than 0

tq

Number is greater than 0

tq

4.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Fill in the blanks in the program segment below to complete the if statement that checks if a variable a is equal to 5.

int a=5;

if (a ______ 5)

{ cout<< "a is equal to 5"; }

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following control structure is implemented using if statement ?

Sequential

Selection

Looping

Function

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If statement condition always written in ____ parenthesis.

{ }

( )

[ ]

//

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following expression can be used as condition with if statement?

Logical

Relational

Arithmetic

Logical & Relational

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers