Home Forums C Programming C program that reads an integer odd/even? Re: Re: C program that reads an integer odd/even?

#3488
GWILouisaxwzkla
Participant

could do


/****************************************************************
* File Name : c:programstempCG.cpp
* Date : December,7,2008
* Comments : new project
* Compiler/Assembler :
* Modifications :
*
*
*
*
*
* Program Shell Generated At: 2:39:41 p.m.
=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/


#include < stdio.h >
//#include < string.h >
//#include < conio.h >
//#include < math.h >
//#include < iomanip >
//#include < ctype.h >



//main function ******************************

int main ( )
{

int number;

printf ( "enter a number: " );
scanf ( "%i" , & number );

if ( number % 2 == 0 )
printf ( "The number is even n " );
else
printf ( "Then number is odd n " );


return 0 ;
}