i wrote this program and i want display 0, if the character entered is not an alphabet (!@#$% 5 or any other non alphabet)
can i have a quick solution
#include <stdio.h>
void main ()
{
char char1,char2;
printf("\tEnter first character :");
scanf("\t%c", &char1);
printf("\tEnter second character :");
scanf("\n\t%c", &char2);
while (char2 < char1)
{
printf("\t!!!User must enter second character before the first\n");
printf("\tPlease enter valid second character :");
scanf("\n\t%c", &char2);
}
printf("\n\tNumerical Values Between %c and %c\n",char1,char2);
printf("\t................................\n");
printf("\n\tChar\tDecimal\tOctal\tHex\n");
printf("\t=============================\n");
while (char1 <= char2)
{
printf("\t%c\t%d\t%o\t%x\n",char1,char1,char1,char1);
char1++;
}
getch();
}