Monday, March 26, 2012

Program to determine whether an entered number is positive,negative or zero


/*****************<soeasyprograms.blogspot.in>******************/
 /*Program to determine whether an entered number is positive, negative or zero*/

 #include<stdio.h>
 #include<conio.h>
 void main()
 {
     int num;
     clrscr();
     printf("enter the number\n");
     scanf("%d",&num);
     if(num>0)
     {
                printf("Given number is positve");
                }
     if(num<0)
     {
                printf("Given number is negative");
                }
     if(num==0)
     {
                printf("Given number is zero");
                }
                getch();
                }
    /*End of program*/
/*****************<soeasyprograms.blogspot.in>******************/


2 comments:

  1. @sanjuarora can u use switch case to find the same results.i have it in my text book

    ReplyDelete