🔧 33.Operators (Logical Operators)
Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to
33.Operators (Logical Operators)
a) C# da &&, ||, va ! operatorlari ganday ishlaydi? Misol bilan tushuntiring.
b) Quidagi kodning natijasi nima bo'ladi?
int age = 20;
bool isAdult = (age ›= 18) && (age <= 65) ;
Console.WriteLine(isAdult):
Javoblari:
a) && (And operatori) - Ikkita shartning ham to'g'ri bo'lishini talab qiladi. Agar birinchi shart to'g'ri bo'lsa, ikkinchi shartni tekshiradi. Agar ikkinchi shart ham to'g'ri bo'lsa, natija true bo'ladi, aks holda false bo'ladi.
|| (or operatori) - Ikkita shartdan kamida bittasi to'g'ri bo'lsa, natija true bo'ladi. Agar har ikkala shart ham noto'g'ri bo'lsa, natija false bo'ladi.
!(false operatori) - Bu operator shartning qiymatini teskari qiladi. Agar shart to'g'ri bo'lsa, natija false bo'ladi va aksincha.
b) Ikkala shart ham to'g'ri bo'lganligi uchun isAdult o'zgaruvchisi true qiymatini oladi.
Natija: true
🔧 33.Operators (Logical Operators)
📈 37.45 Punkte
🔧 Programmierung
🔧 33.Operators (Logical Operators)
📈 37.45 Punkte
🔧 Programmierung
🔧 Operators (Logical Operators)
📈 37.45 Punkte
🔧 Programmierung
🔧 Logical operators - mantiq operatorlari
📈 27.37 Punkte
🔧 Programmierung
🔧 PYTHON LOGICAL OPERATORS
📈 27.37 Punkte
🔧 Programmierung
🐧 Boolean Logical Operators in C#
📈 27.37 Punkte
🐧 Linux Tipps
🔧 34.Operators (Bitwise Operators)
📈 20.16 Punkte
🔧 Programmierung
🐧 C# Conditional logical OR operator
📈 17.29 Punkte
🐧 Linux Tipps
🔧 Linux Logical Volume Manager overview
📈 17.29 Punkte
🔧 Programmierung
🔧 Physical vs Logical Data Structures
📈 17.29 Punkte
🔧 Programmierung
🔧 SQL Query Logical Order
📈 17.29 Punkte
🔧 Programmierung
🔧 Logical operator
📈 17.29 Punkte
🔧 Programmierung