Question: The program below is supposed to calculate and display the average of three integer numbers. The program compiles with no error, but does not give
The program below is supposed to calculate and display the average of three integer numbers. The program compiles with no error, but does not give the correct result. Write the corrected program. Make as few changes as possible. # include using namespace std; int main() { int num1, num2, num3, average; cout << "Enter number 1: "; cin >> num1; cout << "Enter number 2: "; cin >> num2; cout << "Enter number 3: "; cin >> num3; average = num1 + num2+ num3 /3; cout << "The average is " << "average" << endl; return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
