I know "homework" isn't perceived well on here but I've tried searching online but I'm not really getting anywhere and I'm not asking anyone to complete it, just to point me in the right direction.
I've created this over the course of the last few hours, not much I know but so far so good. Now I have to add to it so it prints two floats after the previous two results (The first sum and the modulo sum). For example, it won't print 4 for 30/7, but rather 4.28 or whatever. TIA :)
int number1, number2, sum; //declares 3 variables
printf("This is used to divide and find the modulo of two integers\n");
printf("Enter your first integer: ");
printf("Enter your second integer: \n");
sum = number1 / number2;
printf("%d / %d = %d\n", number1, number2, sum);
sum = number1 % number2;
printf("%d / %d = %\n", number1, number2, sum);
To print a
%f and convert the number to
printf("%d / %d = %f\n", number1, number2, (float)number1 / number2); // ^ ^^^^^^^
Important things to note about this change (highlighted above):
doubleto make a floating point division.