C
C#2y ago
daniel1

how do i check if a integer is positive ?

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