Question #22314

write a c++program that accept two numbers and displayt their sum,product,and average.

Expert's answer

#include <iostream>
using namespace std;

int n, m;

void main(){

cout<<"enter the first number: ";
cin>>n;
cout<<"enter the second number: ";
cin>>m;

cout<<"sum: "<<m+n<<"\nproduct: "<<m*n<<"\naverage: "<<(m+n)/2.0<<"\n";

system("pause");
}
LATEST TUTORIALS
APPROVED BY CLIENTS