C
C#3y ago
daniel1

how do i check if a integer is positive ?

how do i check if a integer is positive ?
22 Replies
Jester
Jester3y ago
if (x >= 0)
daniel1
daniel1OP3y ago
thx
Jester
Jester3y ago
"if number is greater or equal to 0"
daniel1
daniel1OP3y ago
how do i check if num has only one letter
Jester
Jester3y ago
HmmNoted is starting to sound like homework
Pobiega
Pobiega3y ago
Why don't you experiment a bit?
daniel1
daniel1OP3y ago
it kind of is
Jester
Jester3y ago
think about it, which numbers are only 1 letter?
daniel1
daniel1OP3y ago
like what (num<=10)?
Jester
Jester3y ago
10 is 2 letters
daniel1
daniel1OP3y ago
yeah i know
Jester
Jester3y ago
so what is it then?
daniel1
daniel1OP3y ago
oh num<10
Buddy
Buddy3y ago
Think logically .. if num is EQUAL or LESS than 10 is exactly (num <= 10)
daniel1
daniel1OP3y ago
yeah
Jester
Jester3y ago
nvm
daniel1
daniel1OP3y ago
why was there false both times
Jester
Jester3y ago
bcuz ive made a mistake
daniel1
daniel1OP3y ago
alright
TheRanger
TheRanger3y ago
num >= 0 && num < 10
daniel1
daniel1OP3y ago
yeah wait your right it can be a neagtive 100 but it just cant be a postive 10
Want results from more Discord servers?
Add your server