C Program to Display Characters in Given Range

Question: Write a program in C to generate all characters in the given range from minimum to maximum.

Printing Characters in Given Range


#include<stdio.h>

int main()
{
    int minimum, maximum, i;

    printf("Enter range (0-255)\n");
    printf("Enter minimum: ");
    scanf("%d",&minimum);
    printf("Enter maximum: ");
    scanf("%d",&maximum);
    printf("All characters in range %d to %d are:\n", minimum, maximum);
    for(i=minimum; i<=maximum; ++i)
    {
        printf("%c\t", i);
    }
    return 0;
}

Output of the above program

Enter range (0-255)
Enter minimum: 56
Enter maximum: 67
All characters in range 56 to 67 are:
8       9       :       ;       
<       =       >       ?       
@       A       B       C