Home › Forums › C Programming › C program that reads an integer odd/even? › Re: Re: C program that reads an integer odd/even?
December 7, 2008 at 7:45 pm
#3488
GWILouisaxwzkla
Participant
could do
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | <br /> /****************************************************************<br /> * File Name : c:programstempCG.cpp<br /> * Date : December,7,2008<br /> * Comments : new project<br /> * Compiler/Assembler :<br /> * Modifications :<br /> *<br /> *<br /> *<br /> *<br /> *<br /> * Program Shell Generated At: 2:39:41 p.m.<br /> =-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/<br /> <br /> <br /> #include < stdio.h ><br /> //#include < string.h ><br /> //#include < conio.h ><br /> //#include < math.h ><br /> //#include < iomanip ><br /> //#include < ctype.h ><br /> <br /> <br /> <br /> //main function ******************************<br /> <br /> int main ( )<br /> {<br /> <br /> int number;<br /> <br /> printf ( "enter a number: " );<br /> scanf ( "%i" , & number );<br /> <br /> if ( number % 2 == 0 )<br /> printf ( "The number is even n " );<br /> else<br /> printf ( "Then number is odd n " );<br /> <br /> <br /> return 0 ;<br /> }<br /> <br /> <br /> <br /> |