I will put the code in first! I will not pu the whole code as it takes too much space! I will just put the thing that I need help on!
If I do not put in soem decimals like 10 and 5 or 30 and 10 or something that divides proper, I would give me some crazy results! I tried floating point with %f instead of %d and defined x and y as float also and it gives me -o.something different all the time!Code:else if (choice == 4)
{
printf ("You chose division!\n\n");
printf ("Input the first integer,x:\n");
scanf ("%d", &x);
printf ("Input the second integer, y:\n");
scanf ("%d", &y);
printf ("The result is:%d\n", x / y);
}
What is the mistake or what do I need to do to make it work properly?
BTW, I tried the % operator instead of / division too, then it gives me plain 0!