add new file l11.c
This commit is contained in:
parent
d71303d054
commit
efde4482fc
1 changed files with 51 additions and 0 deletions
51
c/l11.c
Normal file
51
c/l11.c
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main() {
|
||||
int x = 0;
|
||||
char str[100];
|
||||
printf("Enter word ");
|
||||
scanf("%s", str);
|
||||
int len = strlen(str);
|
||||
for(int i = 0; i < len; i++) {
|
||||
if(str[i] == 'a') {
|
||||
x++;
|
||||
}
|
||||
else if(str[i] == 'e') {
|
||||
x++;
|
||||
}
|
||||
else if(str[i] == 'i') {
|
||||
x++;
|
||||
}
|
||||
else if(str[i] == 'o') {
|
||||
x++;
|
||||
}
|
||||
else if(str[i] == 'u') {
|
||||
x++;
|
||||
}
|
||||
else if(str[i] == 'y') {
|
||||
x++;
|
||||
}
|
||||
else if(str[i] == 'A') {
|
||||
x++;
|
||||
}
|
||||
else if(str[i] == 'E') {
|
||||
x++;
|
||||
}
|
||||
else if(str[i] == 'I') {
|
||||
x++;
|
||||
}
|
||||
else if(str[i] == 'O') {
|
||||
x++;
|
||||
}
|
||||
else if(str[i] == 'U') {
|
||||
x++;
|
||||
}
|
||||
else if(str[i] == 'Y') {
|
||||
x++;
|
||||
}
|
||||
}
|
||||
printf("Vowels: %d\n", x);
|
||||
sleep(2);
|
||||
}
|
||||
Loading…
Reference in a new issue