Operatorlar
Suxrob Xayitmurodov
Last updated
Was this helpful?
Was this helpful?
int x = 5, y = 10, result;
// To find which value is greater
// Using Conditional Operator
result = x > y ? x : y;
// To display the result
Console.WriteLine("Result: " + result);
// To find which value is smaller
// Using Conditional Operator
result = x < y ? x : y;
// To display the result
Console.WriteLine("Result: " + result); int day = 2;
switch(day)
{
case 1:
Console.WriteLine(“Monday”);
break;
case 2:
Console.WriteLine(“Tuesday”);
break;
default:
Console.WriteLine(“Wrong day!”);
break;
}