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