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

Assignment Help:

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;

}


Related Discussions:- Program to check even and odd numbers

Explain the different types of errors in php, Explain the different types o...

Explain the different types of errors in PHP. Warnings, Notices and Fatal errors are the types of errors in PHP Notices: Notices signifies non-critical errors, i.e. ac

Example of structure, Example of structure: struct item {       ...

Example of structure: struct item {                 int element;                 node_ptr next; }; typedef node_ptr stack; stack create(void) {

Pointers, Pointers are just numbers, representing addresses in memory. You ...

Pointers are just numbers, representing addresses in memory. You can add to and subtract from pointers, for instance. It is pretty easy to make mistakes with pointer math, however,

Memory management operator, Memory Management Operator In C malloc( ), ...

Memory Management Operator In C malloc( ), calloc( ), realloc( ), and free( ) are used to mange dynamic memory.  In addition to these function C++ have derived two unary ope

Described the isa and hasa class relationships. , Described the ISA and HAS...

Described the ISA and HASA class relationships. How would you apply each in a class design? A: A specialized class "is" specialization of another class and, thus, has the ISA re

Define register simply with bit fields, Define register with bit fields? ...

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

What are the different steps in executing a c program, Question 1 What are...

Question 1 What are the different steps in executing a C program? Explain Question 2 What are the commonly used input/output functions in C? How are they accessed?

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd