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