fork download
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int a, b;
  5. printf("두 수를 입력하세요: ");
  6. scanf("%d %d", &a, &b);
  7. printf("%d + %d = %d\n", a, b, a + b);
  8. printf("%d - %d = %d\n", a, b, a - b);
  9. printf("%d * %d = %d\n", a, b, a * b);
  10. printf("%d / %d = %f\n", a, b, (float)(a / b));
  11. printf("%d %% %d = %d", a, b, a % b);
  12. return 0;
  13. }
Success #stdin #stdout 0s 4268KB
stdin
16 5
stdout
두 수를 입력하세요: 16 + 5 = 21
16 - 5 = 11
16 * 5 = 80
16 / 5 = 3.000000
16 % 5 = 1