Write A C++ Program To Check Number Is Positive Or Negative. The number should be Entered Through User Then program Print the Output.
Logic:-
As we know that if a number is greater than 0 ( Zero ) Than number is positive and if a number is Less than 0 ( Zero ) than a number is Negative and else number is equal to zero then an entered number is Zero or equal to zero. Below is an explanation of the problem with an example. For this type of problem, there maybe maximum 3 cases, all cases are given below.
Case 1:- Either number is greater than zero (Number is Positive).
Case 2:- Either number is less than zero (Number is Negative).
Case 3:- or number is equal to zero (Number is Equal to Zero)
Output:
Enter The Number You Want To Check :
56
Number Is Possitive:
need an explanation for this answer? contact us directly to get an explanation for this answer