DEV Community

Munisa Kuranbekova
Munisa Kuranbekova

Posted on

Logical operators - mantiq operatorlari

Assalomu aleykum! Bugungi mavzuyimiz mantiq operatorlari haqida bo'ladi. C++ dasturlash tilida mantiq operatorlari belgilar orqali ifodalanadi. Bir necha shartlarni bog'lash uchun ham maxsus belgilar mavjud.
&& - va
|| - yoki
! - yo'q ya'n bunday emas yoki to'g'ri kelmaydi.

&&(and) - shu operator ishlatilganda quyidagi shartlar asosida to'g'ri yoki notog'ri javobini qaytaradi.
True && True => True
True && False => False
False && True => False
False && False => False

Agar biror kim tushunmagan bo'lsa True - to'g'ri va False - xato degan ma'noni anglatadi.

Keyingi operatorimiz ||(or) yoki operatori.
True || True => True
True || False => True
False || True => True
False || False => False

ko'rib turganingizdek or operatorini ishlatayotganda shartimiz to'g'ri bo'lishi uchun 2 ta shartdan bittasi to'g'ri bo'lishi kifoya.
! - ushbu operatorga keladigan bo'lsak , bu operator tog'ri bo'lsa notog'ri yoki noto'g'ri bo'lsa to'g'ri deb qaytaradi.
True! => False
False! => True

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay