bugun biz Relational operatorlarni o'rgandik

abdulaziznaziov

abdulaziznaziov

Posted on January 11, 2023

bugun biz Relational operatorlarni o'rgandik

11-dars
Biz bugun darsda Relational operatorlar bilan ishlashni organdik.Bu darsda

#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

 int main(){
// relational operator

/*opereator   interpretion
< bu kichik
<= bu kichik yoki teng
== bu teng .
>= bu katta yoki teng 
> bu kata 
!= bu emas yoki teng*/
Enter fullscreen mode Exit fullscreen mode

mana shu operatorlar bilan ishlashni organdik.
Bu operatorlardan hama misolarni ishlab u ishlagan misolingiz to'g'ri yoki noto'g'riligini bilib olishingiz mumkun
ko'pincha matematik amallar ishlab tekshirib olish uchun ishlatamiz bu operatorlar bilan juda ko'p ishlaymiz dasturchi bo'lib ketsak va bu dasturda ishlab ketsak bu narsani juda ko'p ishlatamiz.Buni ishlatish usuli masalan

int x = 7, y = 6;

   cout << bool (x<y) << endl;

   cout << bool (x!=y) << endl;

   cout << bool (x>y) << endl;

   cout << bool (x==y);

Enter fullscreen mode Exit fullscreen mode

qisqacha varyanti shu yana boshqacha usularda ham ishlatsa bo'ladi masalan kotta misolarda ham ishlatsa bo'ladi.Man shunchaki qisqacha varyantda ko'rsatdim.

Va yana logical operatorlar bilan ham ishlashni o'rgandik.

logical operator 

operator  meaning 
!         not     YOQ
&&        and     VA
||        or      YOKI
*/ 
  ;


  return 0;
}
Enter fullscreen mode Exit fullscreen mode

mana shunday operatorlar bilan ishlashni o'rgandik
bu operator avalgisiga qisman o'xshaydi bunda birinchisi !mana shu yo'q yani inkor operator bo'lib siz ishlagan masalani to'g'ri chiqsa noto'g'riga o'girib inkor qiliberadi.
&& bu operator va degan operator bo'lib siz ishlagan masala tasavur qiling siz 2 ta masala ishladingiz va siz ishlagan masala 1tasi to'g'ri va 2chisi noto'g'ri chiqdi bu operator masakada 1ta noto'g'ri natija chiqsa uni hamasini noto'g'riga aylantiradi .
||bu operatorni vazifasi &&mana bu operatorni huddi o'zi faqat bu operator shuni teskarisini bajaradi yani siz ishlagan masalani bitasi noto'g'ri chiqsayu 2chisi to'g'ri chiqsa hama ishlagan misolizi hamasini to'g'ri qilib natijani chiqarib beradi

@dawroun

💖 💪 🙅 🚩
abdulaziznaziov
abdulaziznaziov

Posted on January 11, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related