-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce6d415
commit 6eccd8d
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main() | ||
{ | ||
|
||
char operation; | ||
float x ,y ; | ||
cout<<"Enter the operation (+ or - or * or /) : "<<endl; | ||
cin>>operation; | ||
cout<<"Enter the two numbers, taking into consideration that the order is important in some operations "<<endl; | ||
cin>>x>>y; | ||
switch(operation) | ||
{ | ||
case'+': | ||
cout<<x<<"+"<<y<<"="<<x+y; | ||
break; | ||
case'-': | ||
cout<<x<<"-"<<y<<"="<<x-y; | ||
break; | ||
case'*': | ||
cout<<x<<"*"<<y<<"="<<x*y; | ||
break; | ||
case'/': | ||
cout<<x<<"/"<<y<<"="<<x/y; | ||
break; | ||
default: | ||
cout<<"ERROR! operation is not found "<<endl; | ||
break; | ||
} | ||
|
||
return 0; | ||
} |