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