/* Program for counting the number of uppercase, lowercase, digit and blank characters in a given statement */ main() { int i=0,u=0,l=0,d=0,b=0; char str[80]; clrscr(); printf("\n\n\t\tThis program will help you to count the number of "); printf("\n\t\t characters in a given sentence."); printf("\n\t\tEnter the string : "); gets(str); while(str[i]!='\0') { if((str[i]>='A')&&(str[i]<='Z')) u++; if((str[i]>='a')&&(str[i]<='z')) l++; if((str[i]>='0')&&(str[i]<='9')) d++; if(str[i]==' ') b++; i++; } printf("\n\n\t\t\t\t - A N S W E R -"); printf("\n\t\tYour string consists of :\n\n\t\t%d Uppercase characters\n\t\t%d Lowercase characters\n\t\t%d Digit characters\n\t\t%d Blank Spaces\n\n\t\t\t\t- STATISTICS OVER -",u,l,d,b); getch(); }