Get Email Subscription

Enter your email address:

Delivered by FeedBurner

Monday, January 4, 2010

Write a program in 'C' to test whether the given integer is even or odd and to print message accordingly.(Using if...........else statement.)

 Toshiba Satellite L505-GS5037 TruBrite 15.6-Inch Laptop (Black)
HP 2009M 20-Inch HD LCD Monitor
#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
int n;
printf("Enter any integer\n");
scanf("%d", &n);
if(n % 2 = = 0)
printf("The integer %d is even \n", n);
else
printf("The integer %d is odd \n", n);
return(0);
}


Samsung 2233SW 21.5-Inch Full HD Widescreen LCD Monitor
For eg :-

Output :-
Enter any integer
25
The integer 25 is odd

Output :-
Enter any integer
10
The integer 10 is even

ViewSonic VA2223wm 22-Inch 16:9 1080p LCD Monitor

Related Posts by Categories



0 comments:

About This Blog

Lorem Ipsum

  © Blogger templates Newspaper III by Ourblogtemplates.com 2008

Back to TOP