Search Header Logo

с++ 2папка 2вар

Authored by Мағжан Усубалиев

Information Technology (IT)

University

Used 1+ times

с++ 2папка 2вар
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is true about while loops?

It executes only if the condition is true

It executes at least once

It is used when the number of iterations is known

It cannot have a break statement

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which loop structure is preferred when a condition must be checked before execution?

While loop

Do-while loop

For loop

Recursive function

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to use a break statement in a loop?

if (condition) break;

break = true;

loop.break();

stop loop;

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the continue statement do in a loop?

Skips the current iteration and proceeds to the next one

Stops the loop execution

Jumps to the end of the program

Executes the loop indefinitely

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many times will this loop execute?

for (int i = 0; i < 5; i++) {cout << i << " ";}

5 times

4 times

6 times

Infinite times

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to exit a loop immediately?

Break

Continue

Return

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following creates an infinite loop?

while (true) { cout << “Hello”; }

for (int i = 0; i < 10; i++) { cout << i; }

do { cout << “Hello”; } while (false);

while (i > 10) { cout << “Hello”; i++; }

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

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

Already have an account?