Program to check a number is positive negative or zero

0
4
#include<stdio.h>
#include<conio.h>
void main()
{
  int a;
  clrscr();
  printf("Enter a number\n");
  scanF("%d",&a);
  if(a>0)
     printf("\n positive number \n");
    else if(a<0)
       printf("\n negative number \n");
  else
     printf("\n given number is zero \n");
getch();
}
   Output 1:
   Enter a number
   20
   positive number
   
   Output 2:
   Enter a number
   -5
   negative number

   Output 3:
   Enter a number
   0
   given number is zero

 

 

 

Program to check a number is positive negative or zero c program to check a number is positive negative or zero check a number is positive negative or zero program to check whether a number is positive negative or zero c program to check whether a number is positive negative or zero number is positive negative or zeron umber is positive negative or zero in c

LEAVE A REPLY

Please enter your comment!
Please enter your name here