write a C program to count number of uppercase and lowercase letters in a given string. the string may be a word or sentence.
Answers
Answered by
0
Explanation:
#include<stdio.h>
#include<string.h>
int main()
{
char s[1001];
int i,countu=0,countl=0;
fgets(s,1001,stdin);
for(i=0;i<strlen(s);i++)
{
if(isupper(s[i]))
countu++;
else if(islower(s[i]))
countl++;
}
printf("lower=%d \nupper=%d",countl,countu);
return 0;
}
Similar questions
Math,
4 months ago
Political Science,
4 months ago
English,
9 months ago
Accountancy,
9 months ago
Math,
1 year ago
Hindi,
1 year ago