fork download
  1. #include <stdio.h>
  2. int func(int n){
  3. if(n<0)
  4. n=-n;
  5. return n;
  6. }
  7. int main(void) {
  8. // your code goes here
  9. int n=-4;
  10. printf("%dの絶対値は%d",n,func(n));
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 5276KB
stdin
Standard input is empty
stdout
-4の絶対値は4