Answer to Question #17534 in C++ for ivan

Question #17534
write a program which computes and prints the following;
(i) Product
(ii) Sum
(iii) Difference
(iv)Modules
(v) maximum
(Vi) Minimum
use variable of your own choice
1
Expert's answer
2012-10-30T11:32:21-0400
#include<iostream>
#include<conio.h>

using namespace std;

int main ()
{
intfirst, second;
cout<< "Enter first number: " << endl;
cin>> first;
cout<< "Enter second number: " << endl;
cin>> second;
cout<< endl;

cout<< "Product: " << first*second << endl;
cout<< "Sum: " << first+second << endl;
cout<< "Difference: " << first-second << endl;
cout<< "Modules: " << first%second << endl;

if(first > second) {
cout<< "Max: " << first << endl;
}else cout << "Max: " << second << endl;

if(first < second) {
cout<< "Min: " << first << endl;
}else cout << "Min: " << second << endl;

cout<< endl;
system("pause");

return0;

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS