Write an algorithm to find whether a number is positive or negative
Answers
Answered by
158
ALGORITHM TO FIND WHETHER NUMBER IS POSITIVE, NEGATIVE OR ZERO (IS ELSE-IF ELSE STRUCTURE)
- Num <-- 0.
- Read Num.
- Is (Num > 0) Then. Begin. Print “Positive” End. Else if (Num<0) Then. Begin. Print “Negative” End. Else. Begin. Print “Zero” End.
Answered by
222
Algorithm To Find Whether A Number Is Positive Or Negative is given below:
1. Input a number from the user.
2. If number is less than zero, then it is a negative integer.
3. Else if number is greater than zero, then it is a positive integer.
4. Else, the number is equal to zero.
5. End.
Similar questions