Program:-
#include<stdio.h>
#include<string.h>
int main()
{
int up=0,lr=0;
char ch[150];
printf("Enter the String:-\n");
scanf("%[^\n]",ch);
int i=0;
while(ch[i]!='\0')
{
if(ch[i] >= 'A' && ch[i] <= 'Z')
{
up++;
}
if(ch[i] >= 'a' && ch[i] <= 'z')
{
lr++;
}
i++;
}
printf("UpperCase Letters:%d\n",up);
printf("LowerCase Letters:%d",lr);
return(0);
}
No comments:
Post a Comment