Assalomu aleykum 13.08.24 biz c++ codlash tilida 5 darsimizni otdik va bu men tushungan narsalarim.
BUTTSAN
Posted on August 15, 2024
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
💖 💪 🙅 🚩
BUTTSAN
Posted on August 15, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
privacy Caught in the Crunch My Journey from Snacks to 2 Million Exposed Users Privacy
November 30, 2024
devchallenge Submission for the DevCycle Feature Flag Challenge: Feature Flag Funhouse
November 30, 2024