We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 159bd2b commit 577920eCopy full SHA for 577920e
string8.c
@@ -0,0 +1,26 @@
1
+// Write a function to count the occurrence of vowels in a string.
2
+#include<stdio.h>
3
+#include<string.h>
4
+void occurrence(char str[]);
5
+int main()
6
+ {
7
+ char str[100];
8
+ printf("Enter your string : ");
9
+ fgets(str,100,stdin);
10
+ occurrence(str);
11
+ return 0;
12
+ }
13
+void occurrence(char str[])
14
15
+ int count=0;
16
+ strlwr(str);
17
+ for(int i=0;i<strlen(str);i++)
18
19
+ if(str[i]=='a' || str[i]=='e' || str[i]=='i' || str[i]=='o' || str[i]=='u')
20
21
+ count++;
22
23
+
24
25
+ printf("Entered string contains %d vowels \n",count);
26
string8.exe
42.1 KB
0 commit comments