Assalomu aleykum 13.08.24 biz c++ codlash tilida 5 darsimizni otdik va bu men tushungan narsalarim.

birinchisi biz uchta kutubhona chakiramiz ikinchisi esa ikta verible yaratamiz va unga nom beramiz
va ularga kiymat beramiz bu son kelgin esa ularni hohishingizga karab yoki koshasiz yoki ayirasiz
yana oz hohishizga qarab ularga boshqa son ham berisingiz mumkin pasta korib turibsiz va ohiriga cout kilamiz

#include <iostream>
#include <iomanip>
#include <cmath> using namespace std;
int main(){
int a = 5, b= 7; 

kelgisi
bu cod 5 honali sonni yaxlitlab beradi masalan input; 13900,
yozilsa 14000 chiqazadi.

int main (){ int son ; cin >> son; float newSon = son; cout << round(newSon / 1000) * 1000; return 0;
} 

bu cod birorta sonni necha soat , necha minut , necha secund ekanligini chiqazib beradi.

int main (){ int secund; cin >> secund; cout << setw(2) << setfill ('0') << secund / 3600 << ":"; cout << setw(2) << setfill ('0') << secund % 3600 / 60 << ":"; cout << setw(2) << setfill ('0') << secund % 60 << ":"; return 0; }

va shu bilan men sizlar bilan hayirlashaman


Discover more from Coursity

Subscribe to get the latest posts sent to your email.

Leave a Comment

Your email address will not be published. Required fields are marked *

Discover more from Coursity

Subscribe now to keep reading and get access to the full archive.

Continue reading

Scroll to Top
Aantal domeinen te hosten bij getphphost. Google algorithm updates are a constant reality for website owners. Flutter app development.