Code Scrappers


Count The no. Of Uppercase & Lowercase Letters


              #include<stdio.h>
              #include<stdlib.h>

              void main()
              {
                 int u = 0, l = 0, i = 0;

                 char c[80];

                 printf("\n enter string : ");

                 scanf("%s",c);

                 while (c[i])
                 {
                    if (c[i] >= 'A' && c[i] <= 'Z')
                    {
                       u++;
                    }

                    if (c[i] >= 'a' && c[i] <= 'z')
                    {
                       l++;
                    }

                    i++;
                 }

                 printf("\n no. of uppercase letters : %d", u);

                 printf("\n no. of lowercase letters : %d", l);

              }


          



Output

    enter string : CodeScrappers

    no. of uppercase letters : 2

    no. of lowercase letters : 11