Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
Write a program that input a string from the user and counts the number of vowels in the string
+1
vote
asked
Jul 26, 2019
by
anonymous
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
2 Answers
0
votes
answered
Jul 29, 2019
by
Rashmi Joshi
(
140
points)
#include <stdio.h>
#include<string.h>
int main()
{
char str[100];
int i,count=0,len;
printf("enter string");
gets(str);
len=strlen(str);
for(i=0;i<len;i++)
{
if(str[i]=='a' || str[i]=='e' || str[i]=='i' || str[i]=='o' || str[i]=='u' || str[i]=='A' || str[i]=='I' || str[i]=='E' || str[i]=='O' || str[i]=='U')
count++;
}
printf("\nno of vowels : %d",count);
return 0;
}
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
0
votes
answered
Jul 31, 2019
by
keerthanav666
(
300
points)
#include<stdio.h>
int main()
{
int i,j,c=0,k;
char a[100];
scanf("%[^\n]",a);
for(i=0;a[i];i++);
for(j=0;j<i;j++)
{
if(a[j]=='a'||a[j]=='e'||a[j]=='i'||a[j]=='o'||a[j]=='u')
c++;
}
printf("%d",c);
return 0;
}
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...