C program to check whether a given integer is odd or even
by Nideesh C on April 11, 2011 · 0 comments
in C Programming
/* C program to check whether a given integer is odd or even*/
#include <stdio.h>
#include <conio.h>
void main()
{
int ival, remainder;
clrscr();
printf(“Enter an integer :”);
scanf (“%d”, &ival);
remainder = ival % 2;
if (remainder == 0)
printf (“%d, is an even integer\n”, ival);
else
printf (“%d, is an odd integer\n”, ival);
}
/*—————————–
Output
RUN1
Enter an integer :13
13, is an odd integer
RUN2
Enter an integer :24
24, is an even integer
———————————*/
Not Satisfied ? Just search & get the result
Related posts:
- Sample – Program to enter an integer and find out if it is even or odd.
- Sample – Program to enter an integer and output the cube of that integer.
- Sample – Program to enter an integer and output its 15 multiples.
- Sample – Program to enter an integer and print out its successor.
- Sample – Program to enter an integer and output it in the reversed form.
Tagged as:
C program to check whether a given integer is odd or even,
given integer is odd or even,
odd or even
Me, freelance system administrator having the qualification of Diploma in Electronics & Tele-communication + MCSE + CCNA + CST + 5 years of experience in IT field.
If you like This post, you can follow TheOnlineTutorials on Twitter.
Contact me Via email: support@theonlinetutorials.com
Subscribe to feed via Feed or EMAIL to receive instant updates.
Legal Disclaimer:All information found on the site is without any implied warranty of fitness for any purpose or use whatsoever. Content author/site administrator is not responsible for any loss occurred due to mistakes in this tutorial. Use this tutorial website at your own risk.