#include <stdio.h>
#include <ctype.h>
#define SIZE 100
int main()
{
char wish[SIZE]="#B3stofLuCK!";
int x, digit=0, lower=0, upper=0, other=0;
for(x=0; x < strlen(wish); x++)
{
if(isdigit(wish[x]))
digit++;
else if(islower(wish[x]))
lower++;
else if(isupper(wish[x]))
upper++;
else
other++;
}
printf("No. of digits : %d\n", digit);
printf("No. of lowercase letters : %d\n", lower);
printf("No. of uppercase letters : %d\n", upper);
printf("No. of other characters : %d\n", other);
system("pause");
return 0;
}
Comments