Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- //
- // Calcuator program v1.0
- // (C) by Adm1n_0v3rride 2017
- //
- //
- #include <iostream>
- using namespace std;
- int main()
- {
- int first_number;
- int secound_number;
- int choice;
- int sum; // sums up
- int subtract; // Subtracts both numbers.
- int multiply; // Multiply both numbers.
- float divide; /* User has a choice of geting a float answer or a int answer. */
- int modulo;
- cout << "Welcome to Calcuator program v1.0\n";
- cout << "Please enter a number: " << endl;
- cin>>first_number;
- cout << "Please enter a secound number: " << endl;
- cin>>secound_number;
- cout << "Please select which operation that you are doing \n1.addition\n2.subtraction\n3.multiplication\n4.division\n5.Modulus\n: " << endl;
- cin>>choice;
- if(choice == 1)
- {
- sum = secound_number + first_number;
- cout << "The sum is: "<<sum<<endl;
- }
- if(choice == 2)
- {
- subtract = secound_number - first_number;
- cout << "The answer is: " <<subtract<<endl;
- }
- if(choice == 3)
- {
- multiply = secound_number * first_number;
- cout << "The answer is: " <<multiply<<endl;
- }
- if(choice == 4)
- {
- divide = secound_number / first_number;
- cout << "The answer is: "<<divide<<endl;
- }
- if(choice == 5)
- {
- modulo = secound_number % first_number;
- cout << "The answer is: "<<modulo<<endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment