[prog] Re: more C++

wolf wolf at wolfrising.net
Sat Dec 13 18:46:20 EST 2003


Well this works but I got the answer via trial and error : )
Could anyone help explain very fundamentally why it works when I 
comment out the one line? : )


#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." <<  std::endl;


else //(integer1 % 2 !=0)


std::cout << "Your number is odd." << std::endl;



return 0;
}



More information about the Programming mailing list