#include <stdio.h>
#include <stdlib.h>
int main()
{
int st, nd;
printf("Hello!\a");
getchar();
printf("I'm the manudo's (iMnd) multiplicator 2.0\n");
getchar();
system("clear");
printf("Enter the first number \n");
scanf("%d", &st);
printf("0K, now give me the second number \n");
scanf("%d", &nd);
if (st || nd == 0) printf("Any product of 0 is \"0\"\n");
else printf("The result of the multiplication is \"%d\"\n", st*nd);
return 0;
}
This code is for the multiplication of two numbers, but there's an if that has to check if any of the numbers that the user entered is 0, if yes, program return a message saying that any product of 0 is 0 and if it's not, return the result message. Well that's it has to do.
The problem is if I put 0 and 2 it shows the result and the else message, and for this case I want to the program shows the else message ONLY.