Well, let's look at your code for case 'D':
Code:
if (num2 == 0)
printf("Error can't divide\n");
else
quo = num1/num2;
printf ("%d / %d = ", num1, num2);
printf("%d", quo);
Now let's apply some indentation, for us to help see the flow of logic:
Code:
if (num2 == 0)
printf("Error can't divide\n");
else
quo = num1/num2;
printf ("%d / %d = ", num1, num2);
printf("%d", quo);
There's the problem. Only a single statement (or block) is executed after an "if" or "else".
If you want a series of statements to be executed, they must be within a block:
Code:
if (num2 == 0)
{
printf("Error can't divide\n");
}
else
{
quo = num1/num2;
printf ("%d / %d = ", num1, num2);
printf("%d", quo);
}
Welcome to the forum, then. You've done quite well for a first post ... a clear question, using code tags, and a decent (albeit incomplete) attempt at indentation.
Is this before or after the modifications you've implied (adding the modulus operator, or '%')?
I assume it's after, as you might be using the modulus operator with the second number being a zero since the code after "else" is not isolated to that "else" as I've already explained.