Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- int main(int argc, char** argv) {
- int x=0,z=0,y=0;
- char znak;
- cout<<"You can add,subtract,multiply and divide\n";
- cout<<"Podaj liczbe nr1: ";
- cin>>x;
- cout<<"Podaj znak dzialania ";
- cin>>znak;
- cout<<"Podaj liczbe nr2: ";
- cin>>y;
- if(znak=='+') z=x+y;
- if(znak=='-') z=x-y;
- if(znak=='*') z=x*y;
- if(znak=='/') z=x/y;
- cout<<"wynik: "<<z;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement