fork download
  1. #include <stdio.h>
  2.  
  3. // a ÷ b をする関数 div を作ってください
  4. float div(int a, int b)
  5. {
  6. return ((float)a/(float)b);
  7. }
  8.  
  9.  
  10. int main(void) {
  11. // your code goes here
  12. int a = 10;
  13. int b = 3;
  14. float c = div(a, b);
  15. printf("%d ÷ %d = %f\n", a, b, c);
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
10 ÷ 3 = 3.333333