fork download
  1. #include <stdio.h>
  2.  
  3. void Ascii_AII() {
  4. printf("ASCII table A-Z\n");
  5. for (char c = 'A'; c <= 'Z'; c++)
  6. printf("%c : %d\n", c, c);
  7. }
  8.  
  9. void Ascii_all() {
  10. printf("ASCII table a-z\n");
  11. for (char c = 'a'; c <= 'z'; c++)
  12. printf("%c : %d\n", c, c);
  13. }
  14.  
  15. void Ascii_num() {
  16. printf("ASCII table code 65-90\n");
  17. for (int i = 65; i <= 90; i++)
  18. printf("%d : %c\n", i, i);
  19. }
  20.  
  21. int main() {
  22. int choice;
  23. do {
  24. printf("\n########## MENU ##########\n");
  25. printf("1. Ascii table of characters A-Z\n");
  26. printf("2. Ascii table of characters a-z\n");
  27. printf("3. Ascii table of code 65-90\n");
  28. printf("0. Quit Program\n");
  29. printf("Enter your choice <1,2,3 or 0>: ");
  30. scanf("%d", &choice);
  31.  
  32. switch (choice) {
  33. case 1: Ascii_AII(); break;
  34. case 2: Ascii_all(); break;
  35. case 3: Ascii_num(); break;
  36. case 0: printf("Bye!!\n"); break;
  37. default: printf("Invalid Choice!!\n");
  38. }
  39. } while (choice != 0);
  40.  
  41. return 0;
  42. }
Success #stdin #stdout 0.02s 25764KB
stdin
Standard input is empty
stdout
#include <stdio.h>

void Ascii_AII() {
    printf("ASCII table A-Z\n");
    for (char c = 'A'; c <= 'Z'; c++)
        printf("%c : %d\n", c, c);
}

void Ascii_all() {
    printf("ASCII table a-z\n");
    for (char c = 'a'; c <= 'z'; c++)
        printf("%c : %d\n", c, c);
}

void Ascii_num() {
    printf("ASCII table code 65-90\n");
    for (int i = 65; i <= 90; i++)
        printf("%d : %c\n", i, i);
}

int main() {
    int choice;
    do {
        printf("\n########## MENU ##########\n");
        printf("1. Ascii table of characters A-Z\n");
        printf("2. Ascii table of characters a-z\n");
        printf("3. Ascii table of code 65-90\n");
        printf("0. Quit Program\n");
        printf("Enter your choice <1,2,3 or 0>: ");
        scanf("%d", &choice);

        switch (choice) {
            case 1: Ascii_AII(); break;
            case 2: Ascii_all(); break;
            case 3: Ascii_num(); break;
            case 0: printf("Bye!!\n"); break;
            default: printf("Invalid Choice!!\n");
        }
    } while (choice != 0);

    return 0;
}