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
I need CSGO Wallhack and Human Aimbot Project Description: Need a CSGO hack which can ESP Wallhack and Aimbot realistically. Must be VAC Proof, and ESL proof, as wel

Produce data from fixed OCR areas scanned. Project Description: Project is to design software which can use character recognition only on certain areas of scanned puff's/ jpe

Networking program development. 1.ARP protocol. 2.Switching HUB. 3.wireshark. 4.winpcap library. 5.C++ & MFC. 6.LAN evironment through switch and HUB(static ARP t

What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than a

Overloading Binary Operators Using Friend Function class SI {float i,p,n,r,a; public: SI(){}; SI(int gp,int gn, int gr); void putdata(void); friend SI operato

What is a hash function? Hash function: This is the method from the set 'K' of keys into the set 'L' of memory addresses.   H: K → L These are used to verify the address

Why are all header files not declared in every C program? - Declaring all header files in each program would result in increase in overall file size and load of the program. It

in this problem you are given a board in which some of the elements are placed as shown in below diagram.each element represent a color.fill the other element in the board,such tha

Introduction to I/O interfacing, discuss microcontrollers applications in industry. Detailed product design specifications that have sections on both hardware and software inclu

Overloading Binary Operators class SI {float i,p,n,r,a; public: SI(){}; SI(int gp,int gn, int gr); void putdata(void); SI operator+(SI); }; SI SI::opera