Program to check given number is positive or negative in c language.

#include<stdio.h>
#include<conio.h>
void main()
{
  int N;
  clrscr();
  printf("enter a number=");
  scanf("%d",&N);
  if(N>=0)
  {
  printf("entered number is positive. ");
  }
  else
  {
  printf("entered number is negative. ");
  }
  getch();
 }

■》 Output->

enter a number= -5
entered number is negative.

Comments

Popular posts from this blog

Introduction of java Programming language.

Stack data structure.