uint keyword in C# Last Updated : 22 Jun, 2020 Comments Improve Suggest changes Like Article Like Report Keywords are the words in a language that are used for some internal process or represent some predefined actions. uint is a keyword that is used to declare a variable which can store an integral type of value (unsigned integer) from the range of 0 to 4,294,967,295. It keyword is an alias of System.UInt32. uint keyword occupies 4 bytes (32 bits) space in the memory. Syntax: uint variable_name = value; Example: Input: num: 67 Output: num2: 67 Size of a uint variable: 4 Input: num = 24680 Output: Type of num1: System.UInt32 num1: 24680 Size of a uint variable: 4 Example 1: csharp // C# program for uint keyword using System; using System.Text; class GFG { static void Main(string[] args) { // variable declaration uint num2 = 67; // to print value Console.WriteLine("num2: " + num2); // to print size Console.WriteLine("Size of a uint variable: " + sizeof(uint)); } } Output: num2: 67 Size of a uint variable: 4 Example 2: csharp // C# program for uint keyword using System; using System.Text; namespace Geeks { class GFG { static void Main(string[] args) { // variable declaration uint num1 = 24680; // to print type of variable Console.WriteLine("Type of num1: " + num1.GetType()); // to print value Console.WriteLine("num1: " + num1); // to print size Console.WriteLine("Size of a uint variable: " + sizeof(uint)); // to print minimum & maximum value of uint Console.WriteLine("Min value of uint: " + uint.MinValue); Console.WriteLine("Max value of uint: " + uint.MaxValue); // hit ENTER to exit Console.ReadLine(); } } } Output: Type of num1: System.UInt32 num1: 24680 Size of a uint variable: 4 Min value of uint: 0 Max value of uint: 4294967295 Example 3: csharp // C# program for uint keyword using System; using System.Text; class GFG { static void Main(string[] args) { // variable declaration uint num2 = 4294967297; // to print type of variable Console.WriteLine("Type of num2: " + num2.GetType()); // to print value Console.WriteLine("num2: " + num2); // to print size Console.WriteLine("Size of a uint variable: " + sizeof(uint)); } } Error: When we input wrong integer and also input number beyond the range Constant value `4294967297' cannot be converted to a `uint' Comment More infoAdvertise with us Next Article uint keyword in C# S shivanisinghss2110 Follow Improve Article Tags : C# CSharp-keyword Similar Reads ulong keyword in C# Keywords are the words in a language that are used for some internal process or represent some predefined actions. ulong is a keyword that is used to declare a variable which can store an unsigned integer value from the range 0 to 18,446,744,073,709,551,615. It is an alias of System.UInt64. ulong ke 2 min read ushort keyword in C# Keywords are the words in a language that are used for some internal process or represent some predefined actions. ushort is a keyword that is used to declare a variable which can store an unsigned integer value from the range 0 to 65,535. It is an alias of System.UInt16. Syntax: ushort variable_nam 2 min read void Keyword in C# Keywords are the words in a language that are used for some internal process or represent some predefined actions. void is a keyword, it is a reference type of data type and used to specify the return type of a method in C#. It is an alias of System.Void. Syntax: public void function_name([parameter 2 min read long keyword in C# Keywords are the words in a language that are used for some internal process or represent some predefined actions. long is a keyword that is used to declare a variable which can store a signed integer value from the range of -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. It is an alias of 2 min read short keyword in C# Keywords are the words in a language that are used for some internal process or represent some predefined actions. short is a keyword that is used to declare a variable which can store a signed integer value from the range -32, 768 to 32, 767. It is an alias of System.Int16. Syntax: short variable_n 2 min read Like