write a c++ program to find the average of two numbers
Answers
Answered by
1
Answer:
#include <iostream>
using namespace std;
int main(){
int x,y,sum;
float average;
cout << "Enter 2 integers : " << endl;
cin>>x>>y;
sum=x+y;
average=sum/2;
cout << "The sum of " << x << " and " << y << " is " << sum << "." << endl;
cout << "The average of " << x << " and " << y << " is " << average << "." << endl;
}
Similar questions
Math,
17 days ago
English,
1 month ago
English,
1 month ago
Psychology,
8 months ago
Math,
8 months ago