🔧 Operators
Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to
a) Quyidagi kodni tushuntiring:
int x = 10;
if (x < 5)
{
Console.WriteLine("Less than 5");
}
else if (x == 10)
{
Console.WriteLine("Equal to 10");
}
else
{
Console.WriteLine("Greater than 5");
}
Bu kodda x 10 ga teng. Shuning uchun if (x < 5) sharti noto'g'ri bo'ladi va bu blok ishlamaydi.
Keyin, else if (x == 10) sharti tekshiriladi va bu to'g'ri bo'lgani uchun, "Equal to 10" ekranga chiqariladi.
else qismi esa ishlatilmaydi, chunki oldingi shart bajarildi.
b) Ternary operatorning sintaksisi qanday? Misol keltiring.
Sintaksis: shart ? ifTrue : ifFalse
c) Quyidagi kodda switch qismida qaysi natija chiqadi?
int day = 3;
switch (day)
{
case 1:
Console.WriteLine("Monday");
break;
case 2:
Console.WriteLine("Tuesday");
break;
case 3:
Console.WriteLine("Invalid day");
break;
default:
break;
}
Kodda case 3 bo'lganda break komandasi darhol ishlaydi va Console.WriteLine bloki bajarilmaydi. Shuning uchun hech qanday natija chiqmaydi.
...
🔧 Operators (Logical Operators)
📈 24.26 Punkte
🔧 Programmierung
🔧 33.Operators (Logical Operators)
📈 24.26 Punkte
🔧 Programmierung
🔧 33.Operators (Logical Operators)
📈 24.26 Punkte
🔧 Programmierung
🔧 34.Operators (Bitwise Operators)
📈 24.26 Punkte
🔧 Programmierung
🔧 Python - Assignment Operators
📈 12.13 Punkte
🔧 Programmierung
🕵️ Clop Ransomware operators plunder US universities
📈 12.13 Punkte
🕵️ Hacking
🔧 RxJS 7 - Pipeable Operators
📈 12.13 Punkte
🔧 Programmierung
🔧 Read This if You Hate Ternary Operators
📈 12.13 Punkte
🔧 Programmierung
🔧 Operators
📈 12.13 Punkte
🔧 Programmierung
🔧 Js | Operators |
📈 12.13 Punkte
🔧 Programmierung