I came across this program in my book and read about it.
I don't quite understand the if(number % 2L) statement really means. A ran on google and went to a couple open chats about it and got nothing. All I can make of this is.Code:#include <iostream> using namespace std; int main() { long number=0; cout << endl << "Enter an integer number less than 2 billion: "; cin >> number; if(number % 2L) cout << endl << "your number is odd." << endl; else cout << endl << "your number is even." << endl; return 0; }
The if statment runs starts the if loop.
Number is the variable.
What does the % 2L mean?