This commit is contained in:
Weber 2024-10-14 12:36:08 +00:00
parent 323e53fd88
commit 74f24b092d

View File

@ -57,10 +57,6 @@ bool nasobit(KalkulackaZasobnik *kalkulacka) {
bool delit(KalkulackaZasobnik *kalkulacka) {
float a, b;
if (vyber(kalkulacka, &a, &b)) {
if (a == 0) {
printf ("division by zero\n");
return false;
}
return vloz(kalkulacka, b / a);
}
return false;
@ -120,7 +116,11 @@ int main() {
break;
case '/':
if (!delit(&kalkulacka)) {
printf("noaaa input\n");
if (a == 0) {
printf ("division by zero\n");
return 0;
}
printf("no input\n");
return 0;
}
zobraz_zasobnik(&kalkulacka);