Letters and Digits Total

[ad_1]

Letters and Digits Total
#include 
#include 

int main()
{
    char s[1000];
    int i,alphabets=0,digits=0,specialcharacters=0;

    printf("Enter  the string : ");
    gets(s);

    for(i=0;s[i];i++)
    {
        if((s[i]>=65 && s[i]<=90)|| (s[i]>=97 && s[i]<=122) )
          alphabets++;
        else if(s[i]>=48 && s[i]<=57)
         digits++;
        else
         specialcharacters++;

 	}


    printf("Alphabets =
    printf("Digits =
    printf("Special characters =


    return 0;
}

[ad_2]

Please follow and like us:
Content Protection by DMCA.com