C Program | Count Small Capital Letter Digits Speical Character of an email id

Write a Code on C Program Count Character of an email id :

Code:

#include<stdio.h>
#include<string.h>
void main()
{
int l,i,small,capital,digit,special;
 char s[100];
 printf("Enter an email id:\n");
 gets(s);
 l=strlen(s);
 small=0,capital=0,digit=0,special=0;
 for(i=0;i<l;i++)
 {
  if(s[i]>='a' && s[i]<='z')
      small++;
else if(s[i]>='A' && s[i]<='Z')
      capital++;
else if(s[i]>='0' && s[i]<='9')
      digit++;
 else
      special++;
  }
printf("In string small= %d , capital= %d , digit=%d , special= %d\n",small,capital,digit,special);
}

Output:

 ------------------ 

String:  Count Vowels , reverse a string , convert lower case to upper

Comments

Popular posts from this blog

TOP 10 PROGRAMMING LANGAUAGES COMMING 2021 | ARTICLE

Write a C-program to swap two number:

Print Fibonacci Series using Recursion | C program :