what is work of continue statement in C#?

Answer Posted / aditya n bokade ctrainer

continue statement skips a particular PASS of the loop.

continue statement:

--> skips all the statements mentioned after it inside a loop
--> goes to the next pass by incrementing counter variable

eg.

for (int i = 1; i <= 10; i++)
{
if (i % 2 == 0)
{
continue;
}
MessageBox.Show(i.ToString());//will be skipped when i is even
}

Is This Answer Correct ?    18 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use static methods in c#?

536


What are the properties of string?

492


How do you concatenate in c#?

489


Can we inherit partial class in c#?

507


What is Covariance and contravariance in C#?

561






What is xslt in c#?

474


what is object-oriented programming (oop) language?

487


What is c-sharp (c#)?

536


How can I access the registry from c# code?

518


In which situation(s), the use of "Delegate" is a good idea?

551


Can we overload the main method in c#?

480


Asha buys 16 Chocolates for rs 12 and 24 chocolates for rs 20, if she sold them 30 chocolates for rs 30 then what is the Gain/Loss percentage? Gain(700/19 %) Loss(700/19 %) Gain(500/19 %) Loss(500/19 %) If one person ate 100 grapes in 5 days and 6 more each day from starting, what was the no of grapes he ate on first day? 6 8 10 7 If seven men P, Q, R, S, T, U, V parked his car, P and Q something like that. 6 student J, K, L, M, N, O went for picnic in 2 batches, K and L have to go together, M and O do't go together, if O and L go in one batch then which of these combination will be wrong. Jmnp Jklo klop JKLO a boat can go upstream and down stream, if it goes 5/2 times of downstream at the speed of 6 kmph then what will be the speed of upstream? 15 KMPH 12 KMPH 10 KMPH 11 KMPH A, B, C, D, E sitting on a table, A sits 2 seat left from B and C sits 2 seat right from B then what will not be the combination ACDE

3735


Is php easier than c#?

497


Explain dataset.acceptchanges method in .net?

545


Can you access a hidden base class method in the derived class?

506