Program to find whether a number is positive or negative | faceprep

Program to find whether a number is positive or negative | faceprep

The program to find whether a number is positive or negative is discussed here. Given a number as input, find whether the number is positive or negative.


Program to find whether a number is positive or negative

DESCRIPTION

If the number is greater than 0, print “Positive”.

If the number is less than zero, print “Negative”.

Input & Output format:

Input consists of 1 integer.

Sample Input and Output 1:

56

Positive

Sample Input and Output 2:

-56

Negative


Program to find whether a number is positive or negativeClick here to know more about FACE Prep PRO


Algorithm to find whether a number is positive or negative

  • Input the number.
  • If(num > 0)
  • Print “Positive”
  • Else
  • Print “Negative”


Program to find whether a number is positive or negative

@@coding::1@@


Program to find whether a number is positive or negativeClick here to know more about FACE Prep PRO


Program to find whether a number is positive or negative using ternary operator


@@coding::2@@


Recommended Programs







Program to find whether a number is positive or negative

c