A word is taken from the user and number of vowels is determined..
Select To use this code as it is.. select and copy paste this code into code.cpp file :)
- #include<iostream.h>
- #include<conio.h>
- void main()
- {
- clrscr();
- char str[10];
- int v=0;
- cout<<"Please enter a string: ";
- cin>>str;
- //Coding by: Snehil Khanor
- //http://WapCPP.blogspot.com
- for(int i=0;str[i]!='\0';i++)
- {
- if(str[i]=='a'||str[i]=='A'||str[i]=='e'||str[i]=='E'||str[i]=='i'||str[i]=='I'||str[i]=='o'||str[i]=='O'||str[i]=='u'||str[i]=='U')
- v++;
- }
- cout<<v<<" Number of Vowels are there.";
- getch();
- }
1 comments:
thanks...
Post a Comment