I'd like to ask for help about this. I'm going to input two integers. All of the results are showing except for "modulus". Also the second and third "%d" is remaining as is. Here is the results when I run my program.
Enter First Number: 10
Enter Second Number: 20
10 + 20 = 30
10 - 20 = -10
10 * 20 = 200
10 / 20 = 0
10 % %d = %d
What could be the probable fix if this is my program:
#include <stdio.h>
#include <conio.h>
main()
{
int num1, num2, sum=0, diff=0, prod=0, quot=0, mod=0;
clrscr();
printf("\nEnter First Number:");
scanf("%d",&num1);
printf("\nEnter Second Number:");
scanf("%d",&num2);
sum = num1 + num2;
diff = num1 - num2;
prod = num1 * num2;
quot = num1 / num2;
mod = num1 % num2;
printf("%d + %d = %d", num1, num2, sum);
printf("%d - %d = %d", num1, num2, diff);
printf("%d * %d = %d", num1, num2, prod);
printf("%d / %d = %d", num1, num2, quot);
printf("%d % %d = %d", num1, num2, mod);
getch();
}