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