How to get the max value of unsigned int in C++

2 Answers

0 votes
#include <iostream>
#include <limits>
  
int main() {

    std::cout << std::numeric_limits<unsigned int>::max() << "\n";
}
  
  
  
/*
run:
  
4294967295
  
*/

 



answered Jan 4, 2021 by avibootz
edited Dec 29, 2023 by avibootz
0 votes
#include <iostream>
#include <climits>
   
int main() {
    unsigned int max = UINT_MAX;
    
    std::cout << max << "\n";
}
   
   
   
/*
run:
   
4294967295
   
*/

 



answered Jan 4, 2021 by avibootz
edited Dec 29, 2023 by avibootz

Related questions

1 answer 182 views
1 answer 141 views
1 answer 193 views
...