Skip to content

Commit 5d6af69

Browse files
committed
positivenegzerocheck
1 parent 89c2ed0 commit 5d6af69

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Programs/DSA/pos.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
3+
8. Check The Number Positive Negative or Zero
4+
5+
6+
Input -5 -5 0
7+
Output - Positive Negative Zero
8+
*/
9+
10+
function checkposneg(num) {
11+
12+
if (num > 0) {
13+
14+
return "Positive"
15+
}
16+
else if (num < 0) {
17+
return "Negative"
18+
} else {
19+
return "Zero"
20+
}
21+
22+
23+
}
24+
25+
console.log(checkposneg(0))
26+
console.log(checkposneg(10))
27+
console.log(checkposneg(-5))

0 commit comments

Comments
 (0)