Computer Science, asked by meowteju1119, 10 months ago

Write a c program to count number of vowels and consonants in a given string

Answers

Answered by RishiAEC
3

Answer:

C Program to Count the Number of Vowels, Consonants and so on

#include <stdio.h>

char line[150];

int vowels, consonant, digit, space;

vowels = consonant = digit = space = 0;

printf("Enter a line of string: ");

fgets(line, sizeof(line), stdin);

for (int i = 0; line[i] != '\0'; ++i) {

if (line[i] == 'a' || line[i] == 'e' || line[i] == 'i' ||

Answered by Anonymous
0

Explanation:

Answer:

C Program to Count the Number of Vowels, Consonants and so on

#include <stdio.h>

char line[150];

int vowels, consonant, digit, space;

vowels = consonant = digit = space = 0;

printf("Enter a line of string: ");

fgets(line, sizeof(line), stdin);

for (int i = 0; line[i] != '\0'; ++i) {

if (line[i] == 'a' || line[i] == 'e' || line[i] == 'i' ||

Similar questions