Sunday, September 18, 2011

WAP to check whether the entered number is positive,negative or zero


/*
  Name: WAP to check whether the entered number is positive,negative or zero
  Author: Parveen Malik 
  Date: 18/09/11 09:52
*/


#include<stdio.h>
#include<conio.h>
 int main()
 {
      long num;
      printf("\n\n\nEnter any number : ");
      scanf("%ld",&num);
      if(num>0)
      printf("\n%d is a positive number ",num);
      else if(num<0)
      printf("\n%d is a negative number ",num);
      else
      printf("\n%d is zero ",num);
      main();
      return 0;
      }


OUTPUT:


      

0 comments:

Post a Comment