Hi couldn't find it for C#, I am trying something like that
for (int j = mediumNum; j < hardNum; j++; && int k = 0; k < mediumNum; k++);
but it does not work. Any valid method???
This is what you want
for (int j = mediumNum, k = 0; j < hardNum && k < mediumNum; j++, k++)
If I am understanding correctly, you want this:
for (int j = mediumNum, k = 0; j < hardNum && k < mediumNum; j++, k++)
It might express your intent better to use a while
loop, perhaps making the code a little easier to read:
int j = mediumNum;
int k = 0;
while (j < hardNum && k < mediumNum)
{
//...
j++;
k++;
}
I wonder if you know for sure that both loops always terminate at the same time. If not, the body of the loop will have to account for that.
int j;
int k;
for (j = mediumNum, k = 0; j < hardNum && k < mediumNum; j++, k++);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With