- Mar 13, 2005
- 3,126
- 0
- 0
I need to write a program that will take input from the user and count them. I'm trying to compile this program but I can't get it to compile.
#include <iostream>
#include <iomanip>
using namespace std;
int isAlpha(char ch);
int main()
{
char ch;
int alphaCounter = 0;
cout <<"Please enter a something";
cin.get(ch);
while (ch != '.')
{
while (ch!= '\n')
{
isAlpha(ch);
}
return 0;
}
while isAlpha(char ch)
{
if (ch >= 'A' and ch <= 'Z')
{
alphaCounter += ch;
}
else (ch>= 'a' and ch <= 'z')
{
cout <<"2222";
}
return 1;
}
#include <iostream>
#include <iomanip>
using namespace std;
int isAlpha(char ch);
int main()
{
char ch;
int alphaCounter = 0;
cout <<"Please enter a something";
cin.get(ch);
while (ch != '.')
{
while (ch!= '\n')
{
isAlpha(ch);
}
return 0;
}
while isAlpha(char ch)
{
if (ch >= 'A' and ch <= 'Z')
{
alphaCounter += ch;
}
else (ch>= 'a' and ch <= 'z')
{
cout <<"2222";
}
return 1;
}