This commit is contained in:
Weber 2024-10-14 12:38:06 +00:00
parent ca2b8656fd
commit 651560d3ba

View File

@ -57,6 +57,9 @@ bool nasobit(KalkulackaZasobnik *kalkulacka) {
bool delit(KalkulackaZasobnik *kalkulacka) {
float a, b;
if (vyber(kalkulacka, &a, &b)) {
if (a == 0) {
return false;
}
return vloz(kalkulacka, b / a);
}
return false;
@ -116,8 +119,8 @@ int main() {
break;
case '/':
if (!delit(&kalkulacka)) {
if (a == 0) {
printf ("division by zero\n");
if (delit==false){
printf("divison by zero\n");
return 0;
}
else{