DEV Community

Muhammadyusuf
Muhammadyusuf

Posted on

1

1 chi dars

biz oldingisafar shu kodlarda nimabulishini organdik.

#include <iostream>
Enter fullscreen mode Exit fullscreen mode

bu kodlar kutubhonadeb ataladi.

#include <iomanip>
Enter fullscreen mode Exit fullscreen mode

bu kodlar kutubhonadeb ataladi.

#include <cmath>
Enter fullscreen mode Exit fullscreen mode

bu kodlar kutubhonadeb ataladi.

using namespace std;
Enter fullscreen mode Exit fullscreen mode

bu kod stdni har cout dan oldin .

int main(){
Enter fullscreen mode Exit fullscreen mode

int soni kirg'zishdan oldin quyiladi.

int a;
Enter fullscreen mode Exit fullscreen mode

bu int a bildirip turadi.

cin >> a;
Enter fullscreen mode Exit fullscreen mode

bu kod esa intdan keyin quyiladigon kod.

 string son (a > 19 ? "1" : "0");
Enter fullscreen mode Exit fullscreen mode

bu kod esa agar int songa belgilangan sondan utibketsa bildishnoma uchun quyiladi.

  cout  << son;
Enter fullscreen mode Exit fullscreen mode
return 0;
Enter fullscreen mode Exit fullscreen mode

bu kod kod larni 0marta qaytarddeb buyruqberadi.

}
Enter fullscreen mode Exit fullscreen mode

bu kod esa int main dankeyin kod tugaganini bildiradi.

BIRINCHI KOD TUGADI
Enter fullscreen mode Exit fullscreen mode

.

IKKINCHIKOD BOSHLANDI
Enter fullscreen mode Exit fullscreen mode
    #include <iostream>
Enter fullscreen mode Exit fullscreen mode

bu kodlar kutubhonadeb ataladi.

using namespace std;
Enter fullscreen mode Exit fullscreen mode

bu kod stdni har cout dan oldin .

int son ;
Enter fullscreen mode Exit fullscreen mode

kod yozishdanoldin yoziladi .

cin >> son;
Enter fullscreen mode Exit fullscreen mode

.

cout << (son > 0 ?(son % 2 == 0 ? "musbat fuft":"manfiy "))
Enter fullscreen mode Exit fullscreen mode

bu kod esa agar int sonigakirg'zilgan sonni ogohlantiribturadi.

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

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

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

Okay