Learn C ProgrammingLearn ProgrammingPrograms On Decision Control StructuresResources

015. Write a program to accept a number and print if the number is Positive/Negative in C language

By September 18, 2012 February 5th, 2018 No Comments
#include<stdio.h>
#include<conio.h>  

main()
{
 int n;
 clrscr();
 printf("Enter number..");
 scanf("%d",&n);
 if(n>0)
	printf("Given number is positive");
 else if(n<0)
	printf("Given number is negative");
 else
	printf("Number is Zero");
 getch();
}


Leave a Reply

DEMO01