CS1010 Lab 03

CS1010 Lab 03

University

10 Qs

quiz-placeholder

Similar activities

CC113B-LoopStatementsQuiz-BSCS1A

CC113B-LoopStatementsQuiz-BSCS1A

University

14 Qs

Topic 5: Looping

Topic 5: Looping

University

12 Qs

Lec 5a - Repetition

Lec 5a - Repetition

11th Grade - University

10 Qs

Kuizi 14 - Web

Kuizi 14 - Web

10th Grade - University

15 Qs

Python Basics

Python Basics

University

15 Qs

Control Structures

Control Structures

University

14 Qs

Loops-2

Loops-2

University

15 Qs

Python Programming

Python Programming

University

10 Qs

CS1010 Lab 03

CS1010 Lab 03

Assessment

Quiz

Computers

University

Medium

Created by

Gabriella Gloria

Used 1+ times

FREE Resource

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

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?