DEV Community

Muhammadyusuf
Muhammadyusuf

Posted on

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.

Top comments (0)