Problem Description
Count Total number of Capital and Small Letters from Accepted Linen
Note: (No spaces between words)CODING ARENA::
#include <stdio.h>
int main()
{
char a[100];
int i,u=0,l=0;
scanf("%s",a);
for(i=0;a[i]!='\0';i++)
{
if((int)a[i]>64 && (int)a[i]<91)
u++;
else if((int)a[i]>96 && (int)a[i]<123)
l++;
}
printf("Uppercase Letters:%d\nLowercase Letters:%d",u,l);
return 0;
}
Test Case 1
Input (stdin)SRMUn
Expected OutputUppercase Letters:4 Lowercase Letters:1
Test Case 2
Input (stdin)SRMUniversityLearningCENTRE
Expected OutputUppercase Letters:11 Lowercase Letters:16
No comments:
Post a Comment