if statement

abror07

Abror_7

Posted on January 20, 2023

if statement

Agar rost bo'lsa () ifoda qavussi ichidegi to'gri bo'lsa ifodani yechadi va javobini chiqarib beradi.
Agar ifoda yolg'on bo'lsa uni ishlamaydi.

   if (misol){
}
else if (misol){


  }

Enter fullscreen mode Exit fullscreen mode
  int age1, age2;
  cin >> age1 >> age2;
  if (age1 > age2){
    cout << "birinchi kiritilgani katta: bu son : " << age1;
  }

  return 0;
}
Enter fullscreen mode Exit fullscreen mode

eslse if - Agar shartlarimiz ko'payip ketsa biz else if ni ishlatamiz.

Agar shartimiz bitta bo'lasa biz if va else ni ishalatamiz.
else da nma yozilgan bo'lsa ham if noto'gri bo'lsa elseni chiqarib beradi.

@dawrounn

💖 💪 🙅 🚩
abror07
Abror_7

Posted on January 20, 2023

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

Sign up to receive the latest update from our blog.

Related