why the calculator does not work ?
#include
#include <conio.h>
#include <windows.h>
using namespace std;
char wybor;
float x = 0,z = 0;
void dodawanie (float x){
system(“cls”);
cout << x << " + ";
cin >> z;
x = x + z;
system(“cls”);
cout << x ;
}
void odejmowanie (float x){
system(“cls”);
cout << x << " - ";
cin >> z;
x = x - z;
system(“cls”);
cout << x;
}
void mnozenie(float x){
system(“cls”);
cout << x << " * ";
cin >> z;
x = x * z;
system(“cls”);
cout << x;
}
void dzielenie(float x){
system(“cls”);
cout << x << " / ";
cin >> z;
x = x / z;
system(“cls”);
cout << x;
}
int main(){
for (;;){
cout << x ;
wybor = _getch();
switch (wybor){
case’+’:
dodawanie(x);
case’-’:
odejmowanie(x);
case’*’:
mnozenie(x);
case’/’:
dzielenie(x);
default:
cout <<"blad ";
cin.get(); cin.get();
break;
}
}
return 0;
}