|
|
|
|
|
| Author |
Message |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 18 Feb 2008 13:26:31 IST
|
|
|
/*Program to find the vowels,consonants,words in a sentence*/ #include<iostream.h> #include<conio.h> #include<stdio.h> void main() { char sent[100]; int vowels=0,consonants=0; clrscr(); cout<<"Enter any sentence\n"; gets(sent); for(int i=0;sent[i]!='\0';i++) { if(sent[i]=='a'||sent[i]=='e'||sent[i]=='i'||sent[i]=='o' ||sent[i]=='u') vowels++; else if(sent[i]!=' ') consonants++; } cout<<"The number of vowels in the sentence are "<<vowels<<endl; cout<<"The total number of consonants are "<<consonants<<endl; getch(); }
|
Be not afraid of growing slowly.
Be afraid only of standing still.
|
this reply: 5 points
(with 1 
in 1 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
|
|
|
|
|
|
|