Topic2: If method

Quiz
•
Computers
•
University
•
Easy
AZLINA MYDIN
Used 7+ 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
Similar Resources on Wayground
5 questions
Programar en C básico

Quiz
•
University
15 questions
Python

Quiz
•
6th Grade - University
9 questions
Lenguaje de Programación C++. Parte 1.

Quiz
•
University
15 questions
Quiz 4 Week 6 Repetition Structures (For)

Quiz
•
University
10 questions
PHP MySQL

Quiz
•
University
15 questions
EDA PARTE 2

Quiz
•
University
10 questions
T_4.2 Identifier, Data Types, Operators & Expressions

Quiz
•
12th Grade - University
7 questions
Java Programming Game

Quiz
•
University
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
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University