- #1
chmate
- 37
- 0
Hi guys!
I made a program in C, which count vowels on text, but it doesn't work.
Thats the code i have writed:
Does anybody have an idea where is the problem?
Thanks.
I made a program in C, which count vowels on text, but it doesn't work.
Thats the code i have writed:
Code:
#include <stdio.h>
#include <string.h>
int main()
{
char buffer[80];
int counter;
printf("Enter a line of text: ");
fgets(buffer, sizeof(buffer), stdin);
for(counter=0; buffer[counter]!='\0'; counter++)
{
if(buffer[counter]=='a' && buffer[counter]=='e'
&& buffer[counter]=='i' && buffer[counter]=='o'
&& buffer[counter]=='u')
continue;
printf("In text, we have %d vowels", strlen(buffer[counter]));
return 1;
}
return 0;
}
Does anybody have an idea where is the problem?
Thanks.