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