Write a program to input a number and check number is negative or not.

In this program we input a number and check number is negative or not means if number is less than Zero then number is negative or not.

#include<stdio.h>
#include<conio.h>
void main()
{
int n;
clrscr();
printf("Enter a number=");
scanf("%d",&n);
if(n<0)
printf("\nNegative number");
else
printf("Not negative number");
getch();
}

OUTPUT 






You can follow me on Google+.
Subscribe for recently updates. 

Comments

Popular posts from this blog

Write a program to input age of any person and check he is eligible for voting or not.

Write a program to input two digit number and check number is palindrome or not.

Write a program to input speed of Royal Enfield and check it's running at economic speed or not.