|
-
April 20th, 2004, 03:15 PM
#1
Quiz
You never set bool Even to false, anything other than 0 is true.
#include "stdafx.h"
bool Even( int );
int main()
{
if( Even(21) ) {
bool Even = true;
}
if (Even) {
std::cout << "Number is even!\n";
}
return 0;
}
bool Even( int nbr )
{
bool answer;
if ((nbr % 2) == 0)
answer = true;
else
answer = false;
return answer;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|