C Program for Positive or Negative Number

In this tutorial you will learn about the C Program for Positive or Negative Number and its application with practical example.

C Program for Positive or Negative Number

In this tutorial, we will learn to create a C program that will check the number is Positive or Negative Numbers in C programming.

Prerequisites

Before starting with this tutorial, we assume that you are the best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • Conditional Statements in c programming.

Algorithm:-

Program for Positive or Negative Number.

In this program, we will first take the input number from the user to check. After taking the input, we will use that number in conditional statements to check. Then we will print the output of the program using the “printf() ”  function. Whether it’s a positive, negative, or zero value.

With the help of this program, we can check Positive or Negative Numbers.

Program Code:-

 

Output:-

In the above program, we have first initialized the required variable.

  • n = it will hold the integer input value of the number.

Taking the input number from the user in the integer format.

In this section of code for the program to check, a number is a positive number or a negative number, or a Zero.

Printing the output for the program after checking the conditions.

In this tutorial we have learn about the C Program for Positive or Negative Number and its application with practical example. I hope you will like this tutorial.