Answer to Question #207369 in C for Steve

Question #207369

Design a C program to remove the symbol @ present in the sting and then count total number of Capital and Small case of alphabets from the given input string.

Runtime Input :

funDam@EntalS

Output :

3 9


1
Expert's answer
2021-06-16T01:00:46-0400
#include <stdio.h>
 
int main()
{
    char str[100];
    int countLowercase, countUpperCase;
    int counter;
 
    //assign all counters to zero
    countLowercase = countUpperCase = 0;
 
    printf("Enter a string: ");
    gets(str);
 
    for(counter=0;str[counter]!=NULL;counter++){
 
        if(str[counter]>='A' && str[counter]<='Z')
            countUpperCase++;
        else if(str[counter]>='a' && str[counter]<='z')
            countLowercase++;   
    }
 
    printf("Total Upper case characters: %d\nLower Case characters: %d", countUpperCase, countLowercase);
 
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS