what is work of continue statement in C#?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / prem
void main(){
int i;
for(i=1;i<10;i++)
{
console.write("prem");
continue;
c.w("hi");
}
}
It will print prem 9 times not print hi.
Is This Answer Correct ? | 16 Yes | 0 No |
Answer / ramya
The continue statement passes control to the next iteration
of the enclosing iteration statement in which it appears
using System;
class ContinueTest
{
public static void Main()
{
for (int i = 1; i <= 10; i++)
{
if (i < 9)
continue;
Console.WriteLine(i);
}
}
}
o/p:
9
10
Is This Answer Correct ? | 0 Yes | 0 No |
What is transparent caching with aop ?
Why do we need constructors?
t name of controls, which are displayed same in all browers?
Compare and contrast between the System.Array.CopyTo() and Clone()?
What does m mean in decimal c#?
What Are The .Net Object
what are pointer types in c#
what is CSharp
What is eager loading in c#?
What do you mean by a windows process in regards to memory allocation?
what is method overloading in c#?
What is the use of ienumerable?