Assignment 3
Assignment 3
Q.Calculate the total number of characters in the string and the total number of
vowels in the string with
the number of occurrences in the string.
ALGORITHM
1.Input: Accept a string of characters (could contain spaces,
punctuation, and newline characters).
2.Output:
● Total number of characters (excluding newline).
● Count of each vowel (a, e, i, o, u) and their occurrences in
the string.
PROGRAM CODE
#include <stdio.h>
int main() {
char str[100];
int i=0,count = 0;
int A = 0, E = 0, I = 0, O = 0, U = 0;
fgets(str, 100,stdin);
count++;
A++;
E++;
I++;
O++;
U++;
}
}
return 0;
OUTPUT