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?s an interface class?
Define c# delegate?
Explain the difference between object type and dynamic type variables in c#?
What is the difference between Abstract and Interface?
22 Answers Agile Software, FER, HCL, Sys Universe,
Give some examples for built in datatypes in c#?
Is it possible to nest cfml conditional tags?
Distinguish between system.string and system.text.stringbuilder classes?
What is a hashset c#?
What is the difference between a field and a property in c#?
What are indexers in c# .net?
What is the max value of int32 in c#?
Is c# good for beginners?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)