[prog] Re: more C++
wolf
wolf at wolfrising.net
Sat Dec 13 17:27:01 EST 2003
Thanks for the help : )
Okay so this is what I have now except I receive a message that there
is a parsing error before else, I'm not sure what I'm missing
I've tried taking the { and } out but I thought if there was an if
statement you needed the braces. Is it a little error I'm making that
I just don't seem to see? Or am I way off track?
#include <iostream>
int main()
{
int integer1;
std::cout << "Enter a whole number\n";
std::cin >> integer1;
if(integer1 % 2 == 0)
{
std::cout << "Your number is even.\n";
else(integer1 % 2 !=0)
std::cout << "Your number is odd.\n";
}
return 0;
}
More information about the Programming
mailing list