Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions exercises/calculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,26 @@
Multiplication: 8
Division: 2
*/
#include <iostream>
using namespace std;

#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1

void Calculate(const int& n1, const int& n2){
cout << "SUM: " << n1 + n2 << endl;
cout << "Difference: " << n1 - n2 << endl;
cout << "Multiplication: " << n1 * n2 << endl;
cout << "Division: " << n1 / n2 << endl;
}

int main(){
int num1 , num2;
cout << "Insert first number: ";
cin >> num1;
cout << "Insert second number: ";
cin >> num2;

Calculate( num1 , num2 );
return EXIT_SUCCESS;
}