diff --git a/cv3/program.c b/cv3/program.c index c3c7d03..8fa3aa5 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -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);