Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3) What are the final values of a, b, c in the following code fragment (1.5 point): int a = 6 , b = 127

3)

What are the final values of a,

b, c in the following code fragment (1.5 point):

int a =

6

, b =

127

, c;

c =

(

++a

)

+ (

b

--

);

Answer:

4)

What are the final values of a,

b, c in

the following code fragment (1.5 point):

int a =

6

, b =

127

, c;

c = (a++) + (

--

b);

Answer:

5)

What is displayed by this poorly indented program fragment

(1 point)

int number =

128

,

alpha =

-

320

;

if (number > 0)

if (alpha > 0)

cout

<< One << endl;

else cout << Two << endl;

cout << Three << endl;

6)

Consider the following program fragment:

int x;

cout << "Enter an integer: ";

cin >> x;

if (x >

92

) {

cout << x +

4

<< endl;

}

else {

cout << x << endl;

if

(x <

48

) {

cout << x

-

10

<< endl;

}

else {

cout << x

+

10

<< endl;

}

cout << x << endl;

}

6.1)

Show all messages displayed by the program if the user enters

200

for x? (1 point)

Answer:

6.2)

Same question if the user enters

70

for x?

(1 point)

Answer:

6.3)

Same question if the user enters

0

for x?

(1 point)

Answer

(Please answer 3 - 6)

thanks)

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

More Books

Students also viewed these Databases questions

Question

Identify the types of informal reports.

Answered: 1 week ago

Question

Write messages that are used for the various stages of collection.

Answered: 1 week ago