Topic2: If method

Topic2: If method

University

10 Qs

quiz-placeholder

Similar activities

Ulangan Harian Semester Genap Kelas X MM

Ulangan Harian Semester Genap Kelas X MM

University

10 Qs

C++ Coding Problems

C++ Coding Problems

4th Grade - Professional Development

10 Qs

If else

If else

University

15 Qs

Loops-2

Loops-2

University

15 Qs

C++ misc-1

C++ misc-1

University

15 Qs

training ep.2

training ep.2

University

11 Qs

C++ : Assignment 6

C++ : Assignment 6

University

10 Qs

FOP - CHAPTER 3

FOP - CHAPTER 3

University

10 Qs

Topic2: If method

Topic2: If method

Assessment

Quiz

Computers

University

Easy

Created by

AZLINA MYDIN

Used 6+ times

FREE Resource

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

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?