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,9 +119,9 @@ int main() {
break;
case '/':
if (!delit(&kalkulacka)) {
if (a == 0) {
printf ("division by zero\n");
return 0;
if (delit==false){
printf("divison by zero\n");
return 0;
}
else{
printf("no input\n");