//Program to illustrate break statement
namespace ProfTyagi
{
class demobreak
{
static void Main(string[] args)
{
int a = 0;
while (a < 10)
{
Console.WriteLine(a);
a++;
if (a == 5)
break;
}
Console.WriteLine("You have seen that as 'a' becomes 5 it comes out of while though vcondition is true at while test");
}
}
}
namespace ProfTyagi
{
class demobreak
{
static void Main(string[] args)
{
int a = 0;
while (a < 10)
{
Console.WriteLine(a);
a++;
if (a == 5)
break;
}
Console.WriteLine("You have seen that as 'a' becomes 5 it comes out of while though vcondition is true at while test");
}
}
}

No comments:
Post a Comment