Pages

Friday, 18 March 2011

PROGRAM TO CHECK WHETHER THE ENTERED NUMBER IS EVEN OR ODD

DESCRIPTION-:THIS PROGRAM CHECKS WHETHER THE GIVEN NUMBER IS
EVEN OR ODD
PROGRAM-:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n;
cout<<"enter any number";
cin>>n;
if(n%2==0)
{
cout<<"number is even";
}
else
{
cout<<"number is odd";
}
getch();
}

0 comments:

Post a Comment

 
Copyright (c) 2010 Concepts Of C++. Design by WPThemes Expert

Blogger Templates and RegistryBooster.