From 3f19705323f81464f5d4d23e75d0bfde8942bc60 Mon Sep 17 00:00:00 2001 From: Weber Date: Mon, 14 Oct 2024 11:54:21 +0000 Subject: [PATCH] test --- cv3/program.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cv3/program.c b/cv3/program.c index 24975ca..5c4f529 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -58,7 +58,8 @@ bool delit(KalkulackaZasobnik *kalkulacka) { float a, b; if (vyber(kalkulacka, &a, &b)) { if (a == 0) { - return false; // Delenie nulou + printf("division by zero\n"); + return false; } return vloz(kalkulacka, b / a); } @@ -119,12 +120,10 @@ int main() { } break; case '/': - if (delit(&kalkulacka)) { - zobraz_zasobnik(&kalkulacka); - } else { - printf("division by zero\n"); + if (!delit(&kalkulacka)) { return 0; } + zobraz_zasobnik(&kalkulacka); break; default: printf("no input\n");