CODE;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace GotoNLabelProgram
{
public class Program
{
public static void Main(string[] args)
{
for (int i = 1; i < 100; i++)
{
Console.WriteLine(" ");
if (i>= 10)
break;
for (int j = 1; j < 100; j++)
{
// Console.WriteLine(" ");
// if (j == i)
// {
Console.Write(" * ");
if (j == i)
goto loop1;
}
loop1: continue;
}
Console.WriteLine("Termination by Break");
Console.ReadKey();
}
}
}
OUTPUT:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace GotoNLabelProgram
{
public class Program
{
public static void Main(string[] args)
{
for (int i = 1; i < 100; i++)
{
Console.WriteLine(" ");
if (i>= 10)
break;
for (int j = 1; j < 100; j++)
{
// Console.WriteLine(" ");
// if (j == i)
// {
Console.Write(" * ");
if (j == i)
goto loop1;
}
loop1: continue;
}
Console.WriteLine("Termination by Break");
Console.ReadKey();
}
}
}
OUTPUT:
No comments:
Post a Comment