Login to ask a question from Strings in C programming

Write a C program to find total number of vowels and consonants in a string.

Without using pointers:

/**
 * C program to count total number of vowel or consonant in a string using switch case
 */

#include 
#include 
#define MAX_SIZE 100 // Maximum string size

int main()
{
    char str[MAX_SIZE]; 
    int i, len, vowel, consonant;

    /* Input strings from user */
    printf("Enter any string: ");
    gets(str);


    vowel = 0;
    consonant = 0;
    len = strlen(str);

    for(i=0; i='a' && str[i]='A' && str[i]= 'a' && *s = 'A' && *s ....
Show More
Previous Question Next Question
🔗

Similar Questions

From Strings in C programming · C programming

View All
WhatsApp