In this article we learn how to find positive or Negative number in C .
Let’s write program to find positive or negative nmber in C .
Step 1: Let’s open turbo c/c++ and write the following code
//Add preprocessor file
long int n;
printf(“enter any number :”);
// Assign value in variable
printf(“number is positive”);
printf(“number is negative”);
Step 2: Now save it by pressing F2 and name it POSITIVE.CPP and click OK.
Step 3: Now compile it by pressing ALT+F9 or click on compile then click on OK.
Step 4: Run the program by presing ALT+R ,and see the output.
Suppose if we enter 10
then the result is – nunber is positive.