Loops in C++

Loops in C++

13 Qs

quiz-placeholder

Similar activities

C++ Array Quick Review

C++ Array Quick Review

University

10 Qs

Variables in C++

Variables in C++

6th Grade

10 Qs

Quiz 2

Quiz 2

University

11 Qs

C++ - Loops and Random Numbers

C++ - Loops and Random Numbers

9th - 12th Grade

14 Qs

C++ Programming Quiz

C++ Programming Quiz

12th Grade

10 Qs

Pemrograman C++ (Dasar)

Pemrograman C++ (Dasar)

11th Grade

18 Qs

Topic2: If method

Topic2: If method

University

10 Qs

Dasar Pemrograman C++

Dasar Pemrograman C++

10th Grade

10 Qs

Loops in C++

Loops in C++

Assessment

Quiz

Computers

Hard

Created by

Shiny Verghese

Used 24+ times

FREE Resource

13 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What output is produced by the following segment of code:


for(int i = 0; i < 10; i++)

cout << i << " ";

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9

1 2 3 4 5 6 7 8 9 10

1 2 3 4 5 6 7 8 9

Infinite Loop

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What output is produced by the following segment of code:


for(int fun = 20; fun > 1; fun -=3)

cout << fun << " ";

20 17 14 11 8 5 2 -1

20 17 14 11 8 5 2

17 14 11 8 5 2 -1

20 17 14 11 8 5

Infinite Loop

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What output is produced by the following segment of code:


int start = 5;

int end = 20;

for(; start <= end; start +=2)

cout << start << " ";

5 7 9 11 13 15 17 19 21

7 9 11 13 15 17 19 20

7 9 11 13 15 17 19 21

5 7 9 11 13 15 17 19

Infinite Loop

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What output is produced by the following segment of code:


for (int x = 10; x > 0; x++)

cout << x << " ";

10 9 8 7 6 5 4 3 2 1

10 9 8 7 6 5 4 3 2 1 0

9 8 7 6 5 4 3 2 1

No Output

Infinite Loop

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What output is produced by the following segment of code:


for (int x = 5; x > 0; x--);

cout << * << " ";

* * * * *

* * * * * *

*

No Output

Infinite Loop

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is the output of the above program?

0 1 2 3 4

0 1 2 3

0 1 2 4

0 1 2

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is the output of the above program?

0 1 2 3 4

0 1 2 3

0 1 2

0 1

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?