-
#include <iostream.h>
#include <stdio.h>
int printcharacter(char ch)
{
switch(ch)
{ case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
return 1;
default:
return 0;
}
}
void main()
{
char ch;
int vowel;
cout << "Enter character: " << endl;
while ((ch = getchar()) !='\n')
{
vowel = printcharacter (ch);
if (printcharacter(ch))
cout << ch << " is a vowel" << endl;
else
cout << ch << " is a consonant" << endl;
}
}
Oh yes....I am the man!
------------------
-
That's either a Basic program, or a C program to get a program to have the user input a character, and when he does the program either tells him if it's a vowel or a consonant.
But I don't see where your allowing the input from the user.
YOu have to remember, users need instruction!
------------------
As miserable as life may be I hold it pretty precious...
If I lose the light of the sun, I will write by candlelight, moonlight, no light. If I lose paper and ink, I wil write in blood on forgotten walls. I will write always, I will capture nights all over the world and bring them to you.
Word And Voice
Motocross Fanatics
General Philosophy
-
<BLOCKQUOTE><font size="1" face="Bradley Hand ITC, Tahoma, Lucinda Console">quote:</font><HR>Originally posted by TastinGood:
cout << "Enter character: " << endl;
<HR></BLOCKQUOTE>
------------------
[This message has been edited by TastinGood (edited February 21, 2002).]
-
what's wrong with printf?
------------------
Sure the universe is a great place, but if it wasn't here, no-one would miss it.
-
that is sad....you have been in that class for over a month, and that is the best you can do.
------------------
Look at that. She think I got siphlus and TB and a hard on and I gonna cut her up with a razor and lif her purse. Ooo-Wee.