#include <limits>
int imin = std::numeric_limits<int>::min(); // minimum value
int imax = std::numeric_limits<int>::max(); // maximum value (2147483647)
#include <climits>
INT_MAX // 2147483647
int INT_MAX = 2147483647;
// C
#include <limits.h>
unsigned int max_unsigned_int_size = UINT_MAX;
// C++
#include <limits>
unsigned int max_unsigned_int_size = std::numeric_limits<unsigned int>::max();
2147483647
unsigned long long int = 18 446 744 073 709 551 615
// max example
#include <iostream> // std::cout
#include <algorithm> // std::max
int main () {
std::cout << "max(1,2)==" << std::max(1,2) << '
';
std::cout << "max(2,1)==" << std::max(2,1) << '
';
std::cout << "max('a','z')==" << std::max('a','z') << '
';
std::cout << "max(3.14,2.73)==" << std::max(3.14,2.73) << '
';
return 0;
}
int i=INT_MAX;
#include <algorithm> // these two line of code should bw included
using namespace std;
class RandomClass
{
int Functions(int a,int b)
{
return max(a,b);
}
};
x = 1, y = 2;
fmax(x , y);
//if you want to print it right away:
cout << fmax(x , y);
//if you want to store it:
int j = fmax(x, y);
cout << j;
//output 2
Code Example |
---|
Cpp :: sento freddo a un dente |
Cpp :: c++ map change order |
Cpp :: how to use run total in C++ |
Cpp :: 1822. Sign of the Product of an Array leetcode |
Cpp :: assegnare valori in c++ |
Cpp :: convert char to string c++ |
Cpp :: rgb(100,100,100,0.5) validation c++ |
Cpp :: max of 3 numbers in c++ |
Cpp :: using of and || c++ |
Cpp :: Data Encapsulation in C++ |
Cpp :: c++ str |
Cpp :: cudaMalloc |
Cpp :: hpp files |
Cpp :: c++ cyclic barrier |
Cpp :: xor linked list |
Cpp :: To toggle (flip the status of) the k-th item of the set |
Cpp :: c+ |
Cpp :: what are manipulators in c++ |
Cpp :: C++ Display Numbers from 1 to 5 |
Cpp :: query for rmq using sqrt decomposition |
Cpp :: how the theam are store in database |
Cpp :: how to complie c++ to spesific name using terminal |
Cpp :: floating point exception |
Cpp :: windows install cppcheck |
Cpp :: csv |
Cpp :: c++ power operator |
Cpp :: c++ rainbow text |
Cpp :: print all chrchetrs of a string c++ |
Cpp :: print number with leading zeros |
Cpp :: return function in cpp |