Home / Expert Answers / Computer Science / nbsp-nbsp-nbsp-4-nbsp-nbsp-write-assignment-statements-that-perform-the-following-operations-w-pa610

(Solved):    4.)  Write assignment statements that perform the following operations w ...



 

  4.)  Write assignment statements that perform the following operations with the variables a, b, and c:

 

Adds 2 to a and stores the result in b.

 

Multiplies b by 4 and stores the result in a.

 

Divides a by 3.14 and stores the result in b.

 

Subtracts 8 from b and stores the result in a.

 

Stores the value 27 in a.

 

Stores the character ‘K’ in c.

 

Stores the ASCII code for ‘B’ in c.

 

 

16.) Which of the following are not valid cout statements? (Select all that apply.)

 

a.)cout << "Hello World";

 

b.)cout << "Have a nice day"\n;

 

c.)cout < value;

 

d.)cout << Programming is great fun;

 

17.)Which of the following are not valid cout statements? (Select all that apply.)

 

a.)cout << "Hello World";

 

b.)cout << "Have a nice day"\n;

 

c.)cout < value;

 

d.) cout << Programming is great fun;



We have an Answer from Expert

View Expert Answer

Expert Answer


ANSWER : general syntax for assignment statements: variable = expression ss) b = a + 2 tt) a = b * 4 uu) b = a / 3.14 vv) a = b
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe