using System;
class Program
{
static void Main(string[] args)
{
int a = 5;
int b = 7;
if (a > b)
{
Console.WriteLine(a);
}
else if (b > a)
{
Console.WriteLine(b);
}
else
{
Console.WriteLine("Voy ular teng");
}
}
}
class Program
{
static void Main(string[] args)
{
int a = 5;
int b = 7;
if (a > b)
{
Console.WriteLine(a);
}
else if (b > a)
{
Console.WriteLine(b);
}
else
{
Console.WriteLine("Voy ular teng");
}
}
}
using System;
class Program
{
static void Main(string[] args)
{
int a = 5;
int b = 7;
int c = 3;
if (a > b && a > c)
{
Console.WriteLine(a);
}
else if (b > a && b > c)
{
Console.WriteLine(b);
}
else if (c > a && c > b)
{
Console.WriteLine(c);
}
}
}
class Program
{
static void Main(string[] args)
{
int a = 5;
int b = 7;
int c = 3;
if (a > b && a > c)
{
Console.WriteLine(a);
}
else if (b > a && b > c)
{
Console.WriteLine(b);
}
else if (c > a && c > b)
{
Console.WriteLine(c);
}
}
}
a soni berilgan. Sonning musbat yoki manfiy ekanligini aniqlang. Son 0 ga teng bo'lsa, 0 ni konsolga chiqaring.
using System;
class Program
{
static void Main(string[] args)
{
int a = 5;
if (a > 0)
{
Console.WriteLine("Musbat son");
}
else if (a < 0)
{
Console.WriteLine("Manfiy son");
}
else
{
Console.WriteLine(0);
}
}
}
class Program
{
static void Main(string[] args)
{
int a = 5;
if (a > 0)
{
Console.WriteLine("Musbat son");
}
else if (a < 0)
{
Console.WriteLine("Manfiy son");
}
else
{
Console.WriteLine(0);
}
}
}
a soni berilgan. Berilgan son 5 ga bo'linadimi? Agar bo'linsa konsolga true bo'lmasa false chiqaring.
using System;
class Program
{
static void Main(string[] args)
{
int a = 10;
if (a % 5 == 0)
{
Console.WriteLine("true");
}
else
{
Console.WriteLine("false");
}
}
}
class Program
{
static void Main(string[] args)
{
int a = 10;
if (a % 5 == 0)
{
Console.WriteLine("true");
}
else
{
Console.WriteLine("false");
}
}
}
Berilgan son 3 va 4 ga bo'linadimi? Agar bo'linsa konsolga 'true' bo'lmasa falseni chiqaring
int number = 10;
if (number % 3 == 0 && number % 4 == 0)
{
Console.WriteLine("True");
}
else
{
Console.WriteLine("False");
}
if (number % 3 == 0 && number % 4 == 0)
{
Console.WriteLine("True");
}
else
{
Console.WriteLine("False");
}
int year = 2000;
if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)
{
Console.WriteLine("true");
}
else
{
Console.WriteLine("false");
}
if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)
{
Console.WriteLine("true");
}
else
{
Console.WriteLine("false");
}
c char berilgan. Berilgan char alfavit yoki raqam ekanligini aniqlang. Agar alfavit bo'lsa 'alpha' ni konsolga chiqaring, agar son bo'lsa 'son' ni konsolga chiqaring.
using System;
class Program
{
static void Main()
{
char c = 'a'; // Berilgan char
if (Char.IsLetter(c))
{
Console.WriteLine("alpha");
}
else if (Char.IsDigit(c))
{
Console.WriteLine("son");
}
}
}