C program to check number of lowercase letters in a word

Number of lower case letters in a word

#include<stdio.h>
#include<conio.h>
void main()
{
char ch[100];
int y=0,i=0;
clrscr();
printf("Enter a word:- ");
gets(ch);

while(ch[i]!='\0')
{
 if(ch[i]>='a' && ch[i]<='z')
 y++;
 i++;
}
printf("\nNumber of lower case letters are:- %d",y);
getch();
}

OUTPUT:-

numer of lower case letters in a word

Leave a Reply

Your email address will not be published. Required fields are marked *