Goto
Sobirjonov O'tkirbek


Demak boshladik. 1-misol
2-misol
Last updated
Was this helpful?
Sobirjonov O'tkirbek


Last updated
Was this helpful?
Was this helpful?
using System;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
bool active = false;
string say = "Salom";
key:
if (active)
{
Console.WriteLine(say);
}
if(active == false)
{
active = true;
goto key;
}
Console.ReadKey();
}
}
}using System;
namespace GotoShartOperatori
{
class Program
{
static void Main(string[] args)
{
int n = 0;
if (n == 0) {
while (true)
{
if (n == 10)
{
goto key;
}
n += 2;
}
}
Console.WriteLine("Asosiy");
while (true)
{
Console.WriteLine("Salom");
}
key:
Console.WriteLine("Qalaysiz!");
Console.ReadKey();
}
}
}while (true)
{
Console.WriteLine("Salom");
}