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