foundationda 5 - dars

rivojiddin_f9740e8fb02701

Rivojiddin

Posted on August 14, 2024

foundationda 5 - dars

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;
}
Enter fullscreen mode Exit fullscreen mode

bu cod biror sonni necha soat , necha minut , necha soniya ekanligini chiqazib beradi.

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

    return 0;

}
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
rivojiddin_f9740e8fb02701
Rivojiddin

Posted on August 14, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related