Skip to content

Instantly share code, notes, and snippets.

@batmantec
Created February 2, 2016 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save batmantec/1dc384374e1c16f8813c to your computer and use it in GitHub Desktop.
Save batmantec/1dc384374e1c16f8813c to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main (){
float num1, num2, sum, rest, mult, divi;
cout << "Please enter the first number (calculate the addition, subtraction, product, and division): ";
cin >> num1;
cout << "Please enter the second number (calculate the addition, subtraction, product, and division): ";
cin >> num2;
sum=(num1+num2);
rest=(num1-num2);
mult=(num1*num2);
divi=(num1/num2);
cout << "The addition is: "<<sum<<endl;
cout << "The subtraction is: "<<rest<<endl;
cout << "The product is: "<<mult<<endl;
cout << "The division is: "<<divi<<endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment