fork download
  1. #include <stdio.h>
  2.  
  3. int check_light(int value);
  4.  
  5. int main() {
  6. int value;
  7. printf("Print 1(ON) or 0 (OFF): ");
  8. scanf("%d", &value);
  9. check_light(value);
  10.  
  11. return 0;
  12. }
  13.  
  14. int check_light(int value) {
  15. if (value == 1) {
  16. printf("ON\n");
  17. } else {
  18. printf("OFF\n");
  19. }
  20. return 0;
  21. }
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
Print 1(ON) or 0 (OFF): OFF