Search This Blog

Wednesday, July 27, 2011

given number is +,- or zero


#include <stdio.h>

int
main (void)
{
   /* declarations */
   int a;
 
   printf ("Enter value of a: ");
   scanf ("%d", &a);
   printf ("You entered: %d\n", a );
 
 
if(a>0)
printf("a is the positive integer \n");
 else
  if(a<0)
printf("a is the negative integer\n");
else
if(a == 0)
printf("a is equal to zero \n");

   return (0);
}

No comments:

Post a Comment