fork download
  1. #include <stdio.h>
  2. /*
  3.   演算子を用いた計算のプログラム
  4. */
  5. int main(int argc, char** argv){
  6. // 各種演算
  7. printf("%d + %d = %d\n",5,2,5+2); // 足し算
  8. printf("%d - %d = %d\n",5,2,5-2); // 引き算
  9. printf("%d * %d = %d\n",5,2,5*2); // 掛け算
  10. printf("%d / %d = %d 余り %d\n",5,2,5/2, 5 % 2); // 割り算
  11. return 0;
  12. }
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
5 + 2 = 7
5 - 2 = 3
5 * 2 = 10
5 / 2 = 2 余り 1