Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  4.  
  5. int main(int argc, char** argv) {
  6. int x=0,z=0,y=0;
  7. char znak;
  8. cout<<"You can add,subtract,multiply and divide\n";
  9. cout<<"Podaj liczbe nr1: ";
  10. cin>>x;
  11. cout<<"Podaj znak dzialania ";
  12. cin>>znak;
  13. cout<<"Podaj liczbe nr2: ";
  14. cin>>y;
  15.  
  16. if(znak=='+') z=x+y;
  17. if(znak=='-') z=x-y;
  18. if(znak=='*') z=x*y;
  19. if(znak=='/') z=x/y;
  20. cout<<"wynik: "<<z;
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement