C++
What is the value of average after the following code executes?
double average; average = 4.0 + 3.0 * 2.0 + 1.0;
Consider the following function:
int compute(int n) { int x = 1; for (int i = 1; i <= n; i++) { x *= i; } return x; }
What is the returned value for the following function call?
int value = compute(4);
What is the value of number after the following statements execute?
int number; number = 18 % 4 + 2;
double average; average = 4.0 + 3.0 * 2.0 + 1.0; the value of average after the following code executes is 11 ================================== Consider the following function: int compute(int n) { int x = 1; for (int i = 1; i <= n; i++) { x *= i; } return x; } int value = compute(4); the returned value for the following function call is 24 ================================== int number; number = 18 % 4 + 2; the value of number after the following statements execute is 4
Get Answers For Free
Most questions answered within 1 hours.