if statement: Haqida malumot.
feyyame1
Posted on January 18, 2023
tanlov bayonotlari
Ikki yoki undan ortiq ijro yo'llari o'rtasidan tanlimiz.
If iborasi if esle iborasi switch iborasi.
Misoolar
Bizga butun qiymat berilgan
Agar musbat (>0) bolsa,qiymatni ekranga chiqaramiz.
Agar manfiy bo'lsa,(<0) -1ni ekranga chiqaramiz.
int main () {
int age1, age2;
cin>> age1>> age2;
if (age1 > age2){
cout << "Birinchi kiritilgani katta: Bu son:" << age1;
}
if(age1 == age2){
cout << "ular teng!";
}
Agar ifoda rost bo'lsa, 1- bandni bajaring.
sintaksis.
If (ifoda){
bayonot1
}
*MIsol uchun , agar x o dan katta bo'lsa,
"musbat raqami"ni ekranga chiqaramiz\n
*
int main(){
int x;
cin >> x;
if(x > -10 && x < 10){
x = 0;
cout << x;
}
return 0;
}
💖 💪 🙅 🚩
feyyame1
Posted on January 18, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.