luther
16
Q:

int max in c++

// C++ program to demonstrate the use of std::max 
// C++ program to demonstrate the use of std::max 
#include<iostream> 
#include<algorithm> 
using namespace std; 
int main() 
{ 
    // Comparing ASCII values of a and b 
    cout << std::max('a','b') << "\n"; 
  
    // Returns the first one if both the numbers 
    // are same 
    cout << std::max(7,7); 
  
return 0; 
}  
3
#include <limits>

int imin = std::numeric_limits<int>::min(); // minimum value
int imax = std::numeric_limits<int>::max(); // maximum value (2147483647)
1
2147483647
  unsigned long long int = 18 446 744 073 709 551 615
3
// largest int in c++
signed int iMax = (unsigned int)~0 >> 1;
// largest unsigned int
unsigned int uMax = (unsigned int)~0;
1

New to Communities?

Join the community