Maximum value of unsigned int in C++ Last Updated : 23 Jul, 2025 Comments Improve Suggest changes 4 Likes Like Report In this article, we will discuss the maximum value of unsigned int in C++. Unsigned int data type in C++ is used to store 32-bit integers.The keyword unsigned is a data type specifier, which only represents non-negative integers i.e. positive numbers and zero. Some properties of the unsigned int data type are: An unsigned data type can only store positive values.It takes a size of 32 bits.A maximum integer value that can be stored in an unsigned int data type is typically 4, 294, 967, 295, around 232 - 1(but is compiler dependent).The maximum value that can be stored in unsigned int is stored as a constant in the <climits> header file. whose value can be used as UINT_MAX.A minimum integer value that can be stored in an unsigned int data type is typically 0.In case of overflow or underflow of data type, the value is wrapped around.For example, if 0 is stored in an int data type and 1 is subtracted from it, the value in that variable will become equal to 4, 294, 967, 295. Similarly, in the case of overflow, the value will round back to 0. Below is the program to get the highest value that can be stored in unsigned int in C++: C++ // C++ program to obtain the maximum // value stored in unsigned int #include <climits> #include <iostream> using namespace std; // Function that prints the maximum // value stored in unsigned int void maxUnsignedInt() { // From the constant of climits // header file unsigned int valueFromLimits = UINT_MAX; cout << "Value from climits constant : " << valueFromLimits << "\n"; // Using the wrap around property // of data types // Initialize a variable with 0 unsigned int value = 0; // Subtract 1 from value since // unsigned data type cannot store // negative number, the value will // wrap around and store the // maximum value in it value = value - 1; cout << "Value using the wrap" << " around property : " << value << "\n"; } // Driver Code int main() { // Function call maxUnsignedInt(); return 0; } Output: Value from climits constant : 4294967295 Value using the wrap around property : 4294967295 Create Quiz Comment U UtkarshPandey6 Follow 4 Improve U UtkarshPandey6 Follow 4 Improve Article Tags : Misc C++ Programs Programming Language C++ C Basics CPP-Basics Data Types +3 More Explore C++ BasicsIntroduction to C++3 min readData Types in C++6 min readVariables in C++4 min readOperators in C++9 min readBasic Input / Output in C++3 min readControl flow statements in Programming15+ min readLoops in C++7 min readFunctions in C++8 min readArrays in C++8 min readCore ConceptsPointers and References in C++5 min readnew and delete Operators in C++ For Dynamic Memory5 min readTemplates in C++8 min readStructures, Unions and Enumerations in C++3 min readException Handling in C++12 min readFile Handling in C++8 min readMultithreading in C++8 min readNamespace in C++5 min readOOP in C++Object Oriented Programming in C++8 min readInheritance in C++6 min readPolymorphism in C++5 min readEncapsulation in C++3 min readAbstraction in C++4 min readStandard Template Library(STL)Standard Template Library (STL) in C++3 min readContainers in C++ STL2 min readIterators in C++ STL10 min readC++ STL Algorithm Library3 min readPractice & ProblemsC++ Interview Questions and Answers1 min readC++ Programming Examples4 min read Like