/*(c)Lateral Guys,2010*/
#include
#include
#include
void main()
{
char data[100];
int i,nov=0,noc=0,nows=0,nocl=0;
int LOOP=1,choice=0;
clrscr();
cout<<"\n Enter the paragraph : ";
gets(data);
while(LOOP==1)
{
nov=0; noc=0; nows=0; nocl=0;
clrscr();
cout<<"\n Choice Menu ";
cout<<"\n 1. Vowels";
cout<<"\n 2. Consonants";
cout<<"\n 3. White Space";
cout<<"\n 4. Capital Letters";
cout<<"\n 5. Exit";
cout<<"\n\n Enter your choice 1-5";
cin>> choice;
switch(choice)
{
case 1: for(i=0; data[i]!='\0'; i++)
{
if(data[i]=='A' || data[i]=='a' ||data[i]=='E' || data[i]=='e' ||data[i]=='O' || data[i]=='o' ||data[i]=='I' || data[i]=='i' ||data[i]=='u' || data[i]=='U')
{
nov++;
textcolor(RED);
cprintf("%c",data[i]);
}
else
{
textcolor(WHITE);
cprintf("%c",data[i]);
}
}
cout<<"\n The Vowels = "<
case 2: for(i=0; data[i]!='\0'; i++)
{
if(data[i]=='A' || data[i]=='a' ||data[i]=='E' || data[i]=='e' ||data[i]=='O' || data[i]=='o' ||data[i]=='I' || data[i]=='i' ||data[i]=='u' || data[i]=='U')
{
textcolor(WHITE);
cprintf("%c",data[i]);
}
else
{
noc++;
textcolor(GREEN);
cprintf("%c",data[i]);
}
}
cout<<"\n The consonents = "<
case 3: for(i=0; data[i]!='\0'; i++)
{
if(data[i]==' ')
{
nows++;
textcolor(WHITE);
cprintf("%c",data[i]);
}
}
cout<<"\n The Whitespace = "<
case 4: for(i=0; data[i]!='\0'; i++)
{
if(data[i]>='A' && data[i]<='Z')
{
nocl++;
textcolor(GREEN);
cprintf("%c",data[i]);
}
else
{
textcolor(WHITE);
cprintf("%c",data[i]);
}
}
cout<<"\n The Capital = "<
case 5 : LOOP=0; break;
default: cout<<"\n Wrong Choice Khoteh!!";
}
cout<<"\n Press any Key to Continue !";
textcolor(WHITE);
getch();
}
getch();
}
/*Coded and Compiled By: Sunil Rai (sunilplayer@gmail.com)*/
/*(c)Lateral Guys,2010*/
No comments:
Post a Comment