DEV Community

shavkatovbexzod C++
shavkatovbexzod C++

Posted on

Reletional operators and Logical operators.

  1. Reletional operators - bu taqqoslash operatorlari. Ushbu operatorga kiradigan belgilar: > -> katta; < -> kichik; == -> teng; >= -> katta yoki teng; <= -> kichik yoki teng; != -> teng emas; Kod yozishda ular juda ham muhim. Ularni ishlatish
int a, b;
a = 10;
b = 15;
cout << (a < b ? "to'g'ri" : "noto'g'ri") << endl;
Bu holatda   to'g'ri    degan yozuv chiqishi kerak; 
Enter fullscreen mode Exit fullscreen mode
  1. Logical operators - bu mantig' operatorlari. Ushbu operatorga kiradigan belgilar: ! -> NOT - yo'q; && -> AND - va; || -> OR - yoki; Ularni ishlatish
true&&true -> true - to'gri.
true&&false -> false;
false&&false -> false;

true||true -> true;
true||false -> true; Sababi yoki ni ishlatayotganda 1ta si tog'ri bo'lsa kod to'g'ri bo'ladi.
false||false -> false;
Enter fullscreen mode Exit fullscreen mode

Top comments (0)