C program to check number of uppercase letter in a word

Uppercase letter 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 upper case letter are:- %d",y);
getch();
}

output:-

uppercase letter in a word

Leave a Reply

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