Skip to content
Open

Q3 1 #14

Show file tree
Hide file tree
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
32 changes: 32 additions & 0 deletions IEC2025013/calculator.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <iostream>
using namespace std;

int main(){

int sign;
cout << "Tell us which command you want to perform\n 1) 1 for addition\n 2) 2 for subtraction\n 3) 3 for division\n 4) 4 for multiplication" <<endl;
cin >> sign;

int a,b;
cout << "Enter your 2 numbers which are involved: ";
cin >> a>>b;

if(sign == 1){
cout << a+b << endl;
}
else if(sign == 2){
cout << a-b << endl;
}
else if(sign == 3){
cout << a/b << endl;
}
else if( sign == 4){
cout << a*b << endl;
}
else{
cout << "You didn't enter a valid input"<<endl
}


}

3 changes: 3 additions & 0 deletions IEC2025013/calculator.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
What is a Calculator?

ans) Calculator is an electronic device used to calculate many mathematical tasks.