Check the validity of the statements


Discuss the below:

Q. Consider the following statements:

double num1, num2, num3;
int int1, int2, int3;
int value;

num1 = 5.0; num2 = 6.0; num3 = 3.0;
int1 = 4; int2 = 7; int3 = 8;

and the function prototype:

double cube(double a, double b, double c);

Which of the following statements are valid? If they are invalid, explain why.

a. value = cube (num1, 15.0, num3);

b. cout << cube(num1, num3, mum2);

c. cout << cube(6.0, 8.0, 10.5);

d. cout << cube(num1, num3);

e. value = cube(num1, int2, num3);

f. value = cube(7, 8, 9);

g. value = cube(int1, int2, int3);

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Check the validity of the statements
Reference No:- TGS01937882

Now Priced at $20 (50% Discount)

Recommended (90%)

Rated (4.3/5)