Thursday, 12 January 2012

w.a.p to print number positive or negative.

#include<stdio.h>
#include<conio.h>
void main()
{
    // print no. is positive or negative
     int a;
     clrscr();
     printf("enter number::\n");
     scanf("%d",&a);
     if (a>0)
     {
         printf("no. is positive\n");
     }
      else
      {
         printf("no. is negative\n");
       }
       getch();
}
out put:-
enter number
-5
no. is negative

1 comment: