DEV Community

thequvonc
thequvonc

Posted on

1

katta sonni aniqlash

hozir biz qaysi son katta qaysi son kichkinaligini aniqlab beruvchini yaratamiz!

#include <iostream>
using namespace std;
int main (){
int n,m;
cin >> n >> m;
(n >= m) ? cout << n : cout << m;

}
Enter fullscreen mode Exit fullscreen mode

bu yerda biz oddiy buyruqlardan yani otgan mavzudagi buyruqlarimizda foydalanmoqdamiz nima demoqchiman bu yerda chunarsiz yoki organish kerak bolgan yangi buyrular mavjud emas

bunda birinchi navbatta int ga n va m harflarini kiritib olamiz

cin >> deb uni oqiymiz

(n >= m) ? cout << n : cout << m;
Enter fullscreen mode Exit fullscreen mode

agar javob 1 yani true bolsa unda birinchisi

cout << n 
Enter fullscreen mode Exit fullscreen mode

chiqadi

agar 0 yani false bolsa

cout << m;
Enter fullscreen mode Exit fullscreen mode

natijasi chiqadi!

@dawroun

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

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

Okay