/* 在页面下方的 3/4 处,我有直接在本段下方列出的代码。我需要它来打印剩余部分,但似乎无法正确处理。我知道使用 Modulus 运算符是此功能的关键,但我不知道如何正确使用它。
result = num1 / num2; /* Division */
printf("When 63 is divided by 6 you get %i\n\n", result);
*/
#include <stdio.h>
int main(void)
{
int num1 = 63;
int num2 = 6;
int result;
float nickels = 0.05;
float pennies = 0.01;
float nickPen; /* I really wasn't sure rather to add nickPen as a float or to even add it at all */
printf("This program will do a few computations with two numbers.\n\n");
printf("The two numbers used by this program are 63 and 6.\n\n");
result = num1 + num2; /* Addition */
printf("The sum of 63 + 6 is %i\n", result);
result = num1 - num2; /* Subtraction */
printf("The difference of 63 - 6 is %i\n", result);
result = num1 * num2; /* Multiplication */
printf("The product of 63 * 6 is %i\n", result);
result = num1 / num2; /* Division */
printf("When 63 is divided by 6 you get %i\n\n", result);
nickPen = nickels*100 + pennies*25; /* Multiplication and addition of money */
printf("If you have 100 nickels + 25 pennies you will have $%.2f\n\n", nickPen);
printf("Thank you for using this program");
getchar();
return 0;
} /* End Main*/