Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int x,y;
- char z = ' ' ;
- int ex;
- cout << "Podaj pierwsza liczbe:" << endl;
- cin >> x;
- cout << "Podaj druga liczbe: " << endl;
- cin >> y;
- cout << "Podaj znak: " << endl;
- cin >> z;
- if ( z == '*')
- {
- ex = x * y;
- cout << "Mnozenie wynosi: " << ex;
- }
- else if ( z == '-')
- {
- ex = x - y;
- cout << "Odejmowanie wynosi: " << ex;
- }
- else if ( z == '/')
- {
- ex = x / y;
- cout << "Dzielenie wynosi: " << ex;
- }
- else if ( z == '+')
- {
- ex = x + y;
- cout << "Dodawanie wynosi: " << ex;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment