How do we move particular specific for loop when break other for loop using c#

  • Thread starter Thread starter Gani tpt
  • Start date Start date
G

Gani tpt

Guest
I am using many for loops. In some cases i want to break and go to specific loop.

How to do that..

below is example

int countA = 30;

int countB = 100;

int countC = 50;

for (i=0; i<= countA; i++)

{

for (j=0; j<=countB; j++)

{

for (k=0; k<=countC; k++)

{

if (condition) // this will be true, then go to "i" loop for the next iteration

goto LoopFirst // it should goto "i" loop

break;

}

}

LoopFirst: // it should goto "i" loop

}


can any one tell me, above condition will work...?

Continue reading...
 
Back
Top