Friday, 21 October 2011

Learning C++ Declaration of Constants

Learning C++ Declaration of Constants. This time I will discuss about the determination of even or odd numbers in C + + program that I have made.
Even number is a number divisible by two, while the odd number is a number that is not divisible by 2. so it is very simple once the manufacture of this program, no need to make it convoluted.
The steps are like this:
1. enter the number
2. If the number divided by 2 = 0, then the even number
3. If not, then the odd number
4. completed
For more details, watch as his source code under ni. Here it is the source code.


/ / C + + program to determine an even number or odd



# include <iostream>

# include <stdio.h>

# include <conio.h>



void main ()

{

  int number;

  court <<"Enter the value of Numbers:";

  cin>> number;



  if (number% 2 == 0)

  court <<"Numbers" <<number <<"is an even number";

  else

  court <<"Numbers" <<number <<"is odd";

  getch ();

}

No comments:

Post a Comment