Solve the following problems completely You must provide a h
Solve the following problems completely. You must provide a hard copy of the programs and then outputs. Fix all syntax and logical mots for the following program. Please generate the correct output.//Program Types prints three integer numbers, sums the numbers, calculates//the average, and prints the sum and the average of the three numbers. #include #include Using namespace std; const ONE = 5; const TWO = 6; const THREE = 7; int Main () int sum; float average, cout
Solution
Problem 1:
#include<iostream>
#include<iomanip>
using namespace std;
const int ONE=5;
const int TWO=6;
const int THREE=7;
int main()
{
int sum;
float average;
cout<<fixed<<showpoint;
cout<<setw(5)<<ONE<<TWO<<THREE<<endl;
sum=ONE+TWO+THREE;
average=sum/3;
cout<<\"The sum is \"<<sum<<\"and the average is \"<<average<<endl;
return 0;
}
