Discuss the use of cout in a statements


Discuss the following:

Q: What is the output of the following statements? Suppose a and b are int variables, c is a double variable, and a = 13, b = 5, and c = 17.5.

a. cout <

b. cout << 15 / 2 + c << endl; = 25

c. cout << a / static_cast(b) + 2 * c << endl; = 37

d. cout << 14 % 3 + 6.3 + b / a << endl; = 8.6846153

e. cout << static_cast(c) % 5 + a - b << endl; = 11

f. cout << 13.5 / 2 + 4.0 * 3.5 + 18 << endl; = 33.75

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Discuss the use of cout in a statements
Reference No:- TGS01937973

Now Priced at $20 (50% Discount)

Recommended (91%)

Rated (4.3/5)