fork download
  1. #include <stdio.h>
  2. //練習問題A
  3. int func(int i)
  4. { int b;
  5.  
  6. b=i;
  7.  
  8. if(i<0)
  9. {
  10. b=-i;
  11. }
  12.  
  13. return b;
  14.  
  15. }
  16.  
  17.  
  18.  
  19. int main(void) {
  20. int n, m = -3;
  21. n = func(m);
  22. printf("%dの絶対値は%d\n", m,n);
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
-3の絶対値は3