Hello everyone, I have a pretty basic problem that I cannot seem to get my head around. I have a for loop that is incrementing, and within this for loop I want an if statement that will fire every 4 increments. How can I do this?
Thanks, Ryan
Hello everyone, I have a pretty basic problem that I cannot seem to get my head around. I have a for loop that is incrementing, and within this for loop I want an if statement that will fire every 4 increments. How can I do this?
Thanks, Ryan
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ryan TurneyPosted Sep 26, 2007, 4:37 PM
AlanPosted Sep 25, 2007, 6:35 PM
Something like this:
for (int i = start; i <= finish; i++)
{
if (i > start && (i - start) % 4 == 0)
{
// do something
}
// other code
}