Computer Science, asked by niteshd4421, 4 months ago

Write a program to print average of two numbers enter by the user.​

Answers

Answered by aditya131099
1

Answer:

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, 4 months ago