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