Skip to content

Commit

Permalink
Made changes to main.c file
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuelshub committed Aug 1, 2023
1 parent 11135e6 commit 9ae14fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Binary file added manuelshub/kc
Binary file not shown.
13 changes: 6 additions & 7 deletions manuelshub/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int main()
case '+':
result = add(num1, num2);
break;

case '-':
result = sub(num1, num2);
break;
Expand All @@ -49,21 +49,20 @@ int main()
break;

default:
printf("Invalid Operator!!\n");
printf("Invalid Operator!!\n\n");
return (1);
}

if (result == 0.00 /*|| result < 0.00 || result > 0.00*/)
if (operator == '/' && num2 == 0)
{
sleep(3);
printf("Recompile to use again!\n");
sleep(1.5);
printf("Recompile to use again!\n\n");
}
else
{
sleep(1.5);
printf("\nThe result is %2lf\n", result);
sleep(3);
printf("Recompile to use again!\n");
printf("Recompile to use again!\n\n");
}

return (0);
Expand Down

0 comments on commit 9ae14fd

Please sign in to comment.