Two counters in a for loop for C#

Sarp Kaya picture Sarp Kaya · May 23, 2012 · Viewed 11k times · Source

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???

Answer

Paul Phillips picture Paul Phillips · May 23, 2012

If I am understanding correctly, you want this:

for (int j = mediumNum, k = 0; j < hardNum && k < mediumNum; j++, k++)