Hello,
I have I have a script written in c# and i have an if statement and the condition i want for this statement is to check if an int is equal or bigger than an number, but i don’t know how to do it.
Thank you in advance
Hello,
I have I have a script written in c# and i have an if statement and the condition i want for this statement is to check if an int is equal or bigger than an number, but i don’t know how to do it.
Thank you in advance
That’s one of the most basic things. Why don’t you just look it up on the internet or in a tutorial?
Basically, you’d have at least one variable:
int number = ...; // put your value instead of the dots
if(number >= 5)
{
// do something
}
// or
int a = ...;
int b = ...;
if(a >= b)
{
// do something
}
Something with two literals, such as
if(4>=5)
{
// do something
}
is kind of useless as the result is known at compile time. It’d get optimized away if you compiled it, a modern IDE would also tell you that this check is superfluous.
Thank you very much, finally this wasn’t the problem to my script i want the int to chec if the int was smaller than 5 and i was typed the wrong symbol.