whileLoop

whileLoop

9th - 12th Grade

5 Qs

quiz-placeholder

Similar activities

The Ultimate C++ Quiz

The Ultimate C++ Quiz

5th Grade - Professional Development

7 Qs

While and do while loops

While and do while loops

8th - 9th Grade

10 Qs

Moringa JavaScript Iteration

Moringa JavaScript Iteration

9th Grade - Professional Development

10 Qs

Flowcharts and algorithms

Flowcharts and algorithms

8th - 10th Grade

8 Qs

For loop

For loop

8th - 9th Grade

10 Qs

Fingerprint Classification

Fingerprint Classification

9th - 12th Grade

10 Qs

HTML Booh

HTML Booh

7th - 10th Grade

10 Qs

Tin học 10_Bài 17 (Biến và lệnh gán)

Tin học 10_Bài 17 (Biến và lệnh gán)

10th Grade

10 Qs

whileLoop

whileLoop

Assessment

Quiz

Education

9th - 12th Grade

Medium

Created by

Umit Akdag

Used 5+ times

FREE Resource

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

If a loop does not have a way of stopping, it is called an infinite loop.

Of the following which one is NOT infinite loop?

while (number < 5) ;

{ cout << "Hello" ;

number++; }

int number = 0 ;

while (number < 5)

{ cout < "Hello"; }

while (number < 5)

cout < "Hello";

number++;

while (number < 5)

{ cout < "Hello";

number++; }

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the result of this while loop ?

int number = 0;

while (number < 5)

{ cout << "Hello\n";

number++ ; }

Hello

Hello

Hello

Hello

Hello

Hello

Hello

HelloHelloHelloHello

Hello

Hello

Hello

Hello

Hello

Hello

Hello

Hello

Hello

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

While loop will never iterate, if the test expression is false to start with.

T / F ?

TRUE

FALSE

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

in the test expression(condition), any NONZERO value is evaluated as true.

T / F ?

FALSE

TRUE

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

The while loop is especially useful for validating input. If an invalid value is entered, a loop can require that the user reenter it as many times as necessary.

Which one is a while Loop for Input Validation?

Media Image
Media Image
Media Image