Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 5 (1 point) Given the following code, what is the final value of i? int i,j; for(i=0;i for(j=0;j if(i==2) break; } } Question 5

Question 5 (1 point)

image text in transcribed

Given the following code, what is the final value of i? int i,j; for(i=0;i for(j=0;j if(i==2) break; } }

Question 5 options:

3

4

5

0

Save

Question 6 (1 point)

image text in transcribed

int x; for (x = 0;x > 10;x++) { cout } What is the last thing printed by the above code?

Question 6 options:

8

9

10

11

Nothing is printed

The code never ends

Save

Question 7 (1 point)

image text in transcribed

Which of the following code segments will count from 1 to 99 (including 1 and 99)?

Question 7 options:

for (int i=1; i

for (int i=1; i

for (int i=0; i

for (int i=0; i

for (int i=1; i

Save

Question 8 (1 point)

image text in transcribed

int x = 0; while (x x+=2; cout } What is the output of the above code?

Question 8 options:

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9 10

1 2 3 4 5 6 7 8 9

1 2 3 4 5 6 7 8 9 10

0 2 4 6 8

0 2 4 6 8 10

0 2 4 6 8 10 12

2 4 6 8

2 4 6 8 10

2 4 6 8 10 12

1 3 5 7 9

1 3 5 7 9 11

Nothing is printed

The code never ends

Save

Question 9 (1 point)

image text in transcribed

int x; for (x = 0; x } cout What is the last thing printed by the above code?

Question 9 options:

0

1

2

8

9

10

11

Nothing is printed

The code never ends

Save

Question 10 (1 point)

image text in transcribed

int x; for (x = 0; x cout } What is the last thing printed by the above code?

Question 10 options:

8

9

10

11

Nothing is printed

The code never ends

Save

Question 11 (1 point)

image text in transcribed

int x; for(x = 0;x >= 0; x++) { cout } What is the last thing printed by the above code?

Question 11 options:

8

9

10

11

Nothing is printed

The code never ends

Save

Question 12 (1 point)

image text in transcribed

int x; for (x = 0; x != 10; x+=2) { cout } What is the output of the above code?

Question 12 options:

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9 10

1 2 3 4 5 6 7 8 9

1 2 3 4 5 6 7 8 9 10

0 2 4 6 8

0 2 4 6 8 10

0 2 4 6 8 10 12

2 4 6 8

2 4 6 8 10

2 4 6 8 10 12

1 3 5 7 9

1 3 5 7 9 11

Nothing is printed

The code never ends

Save

Question 13 (1 point)

image text in transcribed

int x; for (x = 0;x cout } What is the first thing printed by the above code?

Question 13 options:

-1

0

1

2

Nothing is printed

Save

Question 14 (1 point)

image text in transcribed

int x = 0; while (x > 10) { x++; } cout What is the last thing printed by the above code?

Question 14 options:

0

1

2

8

9

10

11

Nothing is printed

The code never ends

Save

Question 15 (1 point)

image text in transcribed

int x; for(x = 0;x > 10;x++) { x++; cout } What is the last thing printed by the above code?

Question 15 options:

8

9

10

11

Nothing is printed

The code never ends

Save

Question 16 (1 point)

image text in transcribed

int x = 0; while (x cout ++x; } What is the last thing printed by the above code?

Question 16 options:

8

9

10

11

Nothing is printed

The code never ends

Save

Question 17 (1 point)

image text in transcribed

Question 17 options:

A compound statement that contains variable declarations is called a __________.

Save

Question 18 (1 point)

image text in transcribed

int x; for (x = 0;x > 10; x++) { cout } What is the first thing printed by the above code?

Question 18 options:

-1

0

1

2

Nothing is printed

Save

Question 19 (1 point)

image text in transcribed

int x = 0; while (x x+=2; cout } What is the output of the above code?

Question 19 options:

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9 10

1 2 3 4 5 6 7 8 9

1 2 3 4 5 6 7 8 9 10

0 2 4 6 8

0 2 4 6 8 10

0 2 4 6 8 10 12

2 4 6 8

2 4 6 8 10

2 4 6 8 10 12

1 3 5 7 9

1 3 5 7 9 11

Nothing is printed

The code never ends

Save

Question 20 (1 point)

image text in transcribed

Question 20 options:

Complete the following code segment// count from 1 to 99// 1 is the first number printed// 99 is the last number printedint i=1;while (i cout }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Theory And Application Bio Science And Bio Technology International Conferences DTA And BSBT 2011 Held As Part Of The Future Generation In Computer And Information Science 258

Authors: Tai-hoon Kim ,Hojjat Adeli ,Alfredo Cuzzocrea ,Tughrul Arslan ,Yanchun Zhang ,Jianhua Ma ,Kyo-il Chung ,Siti Mariyam ,Xiaofeng Song

2011th Edition

3642271561, 978-3642271564

More Books

Students also viewed these Databases questions