W.A.P. C++

WAP | CPP | Programs in C++ | C++ Solutions

Snehil Khanor's Binary Log

Write a program to count the number of vowels in a word


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 :)
  1. #include<iostream.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. clrscr();
  6. char str[10];
  7. int v=0;
  8. cout<<"Please enter a string: ";
  9. cin>>str;
  10. //Coding by: Snehil Khanor
  11. //http://WapCPP.blogspot.com
  12. for(int i=0;str[i]!='\0';i++)
  13. {
  14. 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')
  15. v++;
  16. }
  17. cout<<v<<" Number of Vowels are there.";
  18. getch();
  19. }

Search

About WAP C++

Here you'll find a wide range of programs' solution ranging from beginer level to advanced level.
All programs here are made, compiled and tested by me..and are running absolutely fine.. still if you find any bug in any program do let me know :)

Followers

Subscribe via email

Enter your email address:

Delivered by FeedBurner

my Binary Log

Blog Archive



eXTReMe Tracker