Get Email Subscription

Enter your email address:

Delivered by FeedBurner

Monday, January 4, 2010

Write a program in 'C' to input an integer and to print whether it is positive, negative or zero.(Using if.............else statement)



#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
int a;
clrscr( );
printf("Enter any integer\n");
scanf("%d", &a);
if (a > 0)
printf("The integer is positive\n");
else
if (a < 0) printf("The integer is negative\n");
else
printf("The integer is Zero\n");
return(0);
}

For eg :-

Output :-
Enter any integer
25
The integer is positive


Output :-
Enter any integer
-32
The integer is negative

Output :-
Enter any integer
0
The integer is Zero

Related Posts by Categories



0 comments:

About This Blog

Lorem Ipsum

  © Blogger templates Newspaper III by Ourblogtemplates.com 2008

Back to TOP