In: Computer Science
In c++ Design and implement a programming (name it SimpleMath) that reads two floating-point numbers (say R and T) and prints out their values, sum, difference, and product on separate lines with proper labels. Comment your code properly and format the outputs following these sample runs.
//C++ code
#include<iostream>
using namespace std;
//Entry point
int main()
{
/* reads two floating-point numbers*/
cout << "Enter first number: ";
float num1;
cin >> num1;
cout << "Enter second number: ";
float num2;
cin >> num2;
/* prints out their values, sum, difference,
and product on separate lines with proper
labels*/
cout << "The sum of " << num1 << "
and " << num2 << " is : " << (num1 + num2)
<< endl;
cout << "The difference of " << num1
<< " and " << num2 << " is : " << (num1 -
num2) << endl;
cout << "The product of " << num1 <<
" and " << num2 << " is : " << (num1 * num2)
<< endl;
//pause
system("pause");
}
//Output
//If you need any help regarding this solution ......... please leave a comment........ thanks