fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int code;
  5. printf("Enter an ASCII code (0-127): ");
  6. scanf("%d", &code);
  7.  
  8. if (code >= 0 && code <= 127) {
  9. printf("The character for ASCII code %d is: '%c'\n", code, code);
  10. } else {
  11. printf("Invalid ASCII code.\n");
  12. }
  13. return 0;
  14. }
Success #stdin #stdout 0s 5332KB
stdin
Standard input is empty
stdout
Enter an ASCII code (0-127): Invalid ASCII code.