Hope this help
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int c,u,a,e,o,i;
u=a=e=o=i=0;
char text[100];
printf("Enter text please\n ");
gets(text);
for (c=0; c<=strlen(text); c++)
{
if ( text[c] =='u' || text[c] =='U') u++;
else if (text[c] == 'a' || text[c] =='A') a++;
else if (text[c] == 'e' || text[c] =='E') e++;
else if (text[c] == 'o' || text[c] =='O') o++;
else if (text[c] == 'i' || text[c] =='I') i++;
}
printf ("The result:\n");
printf ("There are %d u\n",u);
printf ("There are %d a\n",a);
printf ("There are %d e\n",e);
printf ("There are %d o\n",o);
printf ("There are %d i\n",i);
return 0;
}
Example:
Enter text please
I am a newbie of c programming
The result:
There are 0 u
There are 3 a
There are 2 e
There are 2 o
There are 3 i