Program to check even and odd numbers, C/C++ Programming

Program to check even and odd numbers:

int main()

{

                int  your_number;

                cout << "Enter a whole number: ";

                cin >> your_number;

 

                if (your_number % 2 == 0)

                   cout << "Your number is even\n";

                else

        {

                  cout << "Your number is odd.\n";

                }

cout << "That's all!\n";

return 0;

}

Posted Date: 10/18/2012 8:00:27 AM | Location : United States







Related Discussions:- Program to check even and odd numbers, Assignment Help, Ask Question on Program to check even and odd numbers, Get Answer, Expert's Help, Program to check even and odd numbers Discussions

Write discussion on Program to check even and odd numbers
Your posts are moderated
Related Questions
Define Automatic storage classes - computer programming? The Variables declared within function bodies are automatic by default and automatic variables are declared inside a fu

one of the segments is showing compilation error...

Define register with bit fields? We could define register simply with bit fields: struct DISK_REGISTER { unsigned ready:1; unsigned error_occured:1; unsigned disk_spinni

Logical Operators We say any expression that evaluates to zero is a FALSE logic condition and that evaluating to non-zero value is a TRUE condition. Logical operators are usefu

C CODE FOR PEBBLE MERCHANTS PROBLEM

I have a mini project where I need to write a code .wonder if someone can help me.I already have the forms and webmaster page done just need to code portion

in a program for what purpose print f and scan f is used

to count number of occurances

A: you can exploit by overloading standard operators on a class, the intuition of the users of that class. This allow users program in the language of the problem domain instead of

Available, and the right kind of programs. My son wants to stop using ice. He has organised detox a number of times, and is always successful. It is the next stage, rehab, where