Search Header Logo

CS1010 Lab 03

Authored by Gabriella Gloria

Computers

University

Used 1+ times

CS1010 Lab 03
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Which of the following assertions is true when the loop terminates?

{ x == -1 }

{ x <= -1 }

{ x == n }

{ x > 0 }

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What can be asserted at Line A?

{ y == (x - 2) * (x - 2) }

{ y == x * x }

{ y == (x + 2) * (x + 2) }

{ y == x * x - 4 }

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of the following code?

1 2 3

1 2

2 3

1 2 3 4

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the output of the following code snippet?

5 4 3 2 1 0

5 4 3 2 1

4 3 2 1 0

4 3 2 1

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the output of the following code?

121212

123123

123123123

1212

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the value of sum after the loop?

18

10

12

14

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of the following code?

1 2 3 4

1 3

2 4

1 2 3

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

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?