Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Program to find out number of vowels in a string.
- #include<iostream.h>
- #include<conio.h>
- #include<stdio.h>
- #include<ctype.h>
- void main()
- {
- clrscr();
- char a[80];
- int n=0;
- cout<<"Enter a string: ";
- gets(a);
- for(int i=0;a[i]!='\0';i++)
- if(a[i]=='a'||a[i]=='e'||a[i]=='i'||a[i]=='o'||a[i]=='u')
- ++n;
- cout<<"Number of vowels in the string: "<<n;
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment