floor() function

The floor() function returns the largest possible integer value which is less than or equal to the given argument.

Example:

Input:  value=24.6
Output: 24

Approach

C++

#include <bits/stdc++.h>
using namespace std;

int main()
{
    double value = 24.6;

    cout << floor(value);

    return 0;
}


No comments:

Post a Comment