#include<iostream.h>
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<ctype.h>
int main()
{
char str[60];
int i, length, upalpha = 0, lowapha = 0, digit = 0, special = 0;
clrscr();
cout<<"Enter a string "<<endl;
gets(str);
length= strlen(str );
for(i=0; i<length;i++)
if (isupper (str[i])) upalpha++;
else if (islower(str[i]))lowapha++;
else if (isdigit(str[i]))digit++;
else special++;
cout<<endl<<"Number of upper case = "<<upalpha;
cout<<endl<<"Number of lower case = "<<lowapha;
cout<<endl<<"Number of digits = "<<digit;
cout<<endl<<"Number of special = "<<special;
getch();
return 0;
}
To input a strong and string and find the number o numeric characters, lowercase alphabetical characters, uppercase alphabetical characters and any characters other then the above.