How is an unsigned integer specified in C#? How do you specify the bits of precision? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How is an unsigned integer specified in C#? How do you specify the bits of precision?

The C# SoloLearn course introduces the variable types but never mentions whether an integer is signed or unsigned or how precise it is. Later we learn that there's a class to convert to integers with a certain precision, like Int32. How can I specify the precision when declaring a variable and how can I make it unsigned?

3rd Mar 2017, 10:22 AM
Anthony Vanover
Anthony Vanover - avatar
1 Answer
+ 6
if var unsighned use like ushort ubyte etc and you can test them in your code Console.WriteLine(short.MaxValue); Console.Readline();
3rd Mar 2017, 10:47 AM
code
code - avatar