60 674
Assignments Done
97,7%
Successfully Done
In April 2018

Answer to Question #4541 in C++ for Rameez M Sydeek

Question #4541
write a c++ program to input 2 numbers and print sum, product,difference and quotient of the two nmbers
Expert's answer
#include <iostream>

using namespace std;

void
main(void){
float num1, num2 = 0;
cout << "Enter first
number: ";
cin >> num1;
cout << "Enter second number:
";
cin >> num2;
cout << "Sum: " << num1 + num2
<< endl;
cout << "Product: " << num1 * num2 <<
endl;
cout << "Difference: " << num1 - num2 <<
endl;
if(num2 == 0)
& cout << "Division by zero" <<
endl;
else
& cout << "Quotient: " << num1/num2
<< endl;
cout << "\nInput 0 and press Enter exit...";

cin >> num1;
}

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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions