why c# loop count till 9 if the condition say 10 ? even if the variable is 1
int i=0;
void start ()
{
while(i < 10)
{
Debug.Log(i);
i++;
}
}
p.s and i need to know what have this to do with games ?
why c# loop count till 9 if the condition say 10 ? even if the variable is 1
int i=0;
void start ()
{
while(i < 10)
{
Debug.Log(i);
i++;
}
}
p.s and i need to know what have this to do with games ?
When i == 10, you check the condition if i is less than 10, obviously it’s equal and not less so you are done looping.
int i = 0;
void start()
{
while (i <= 10)
{
Debug.Log(i);
i++;
}
}