fork download
  1. #include <stdio.h>
  2.  
  3. int evenNumber(int n){
  4. int x;
  5. x = 1;
  6. if(n % 2 ==0){
  7. x = 0;
  8. }
  9. return x;
  10. }
  11.  
  12. int main(void) {
  13. int a = 21;
  14. int b;
  15. b = evenNumber(a);
  16. printf("%dは奇数かどうか:%d",a,b);
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
21は奇数かどうか:1