67 011
Assignments Done
99,4%
Successfully Done
In November 2018

Answer to Question #15763 in C++ for christian naumann

Question #15763
write a program that finds the vowels in a user inputted string using the function isvowel.
Expert's answer
#include<string.h>
#include<iostream.h>

char S[100];
char *str;

bool isVowel(char a){
if ((a=='a')||(a=='e')||(a=='y')||(a=='u')||(a=='i')||(a=='o')||(a=='o')) return 1;
else return false;
}


void main(){
cout<<"Enter a string: ";
cin>>S;
cout<<"Vowels: ";
str = &S[0];
for (int i=0; i<=strlen(S); i++){
& if (isVowel(*str)) cout<<*str<<' ';
& str++;
& }
cout<<"\n";
}




Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions