round()
Sanjar Rashidov

Sanjar Rashidov @sanjar777

Joined:
Sep 19, 2024

round()

Publish Date: Nov 2 '24
10 0

Birinchi bo'lib bu funksiyani ishlashi uchun "cmath" kutubxonasi kerak boladi.

round() - bu funksiya kasr sonlarni yaxlitlash uchun ishlatiladi.

Masalan:

#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    float kasr1 = 7.7;
    double kasr2 = 77.7;

    cout << round(kasr1) << endl;
    cout << round(kasr2) << endl;

    return 0;
}
Enter fullscreen mode Exit fullscreen mode

Comments 0 total

    Add comment