Ulong type in C#


The Ulong type in C# is an alias to the System.UInt64 type. It is an Unsigned integer.

Set the Ulong type −

ulong val = 7712059531;

To get the minimum and maximum value for Ulong type −

Console.WriteLine(ulong.MaxValue);
Console.WriteLine(ulong.MinValue);

Here is the complete code −

Example

 Live Demo

using System;
using System.Threading;
using System.Diagnostics;
public class Demo {
   public static void Main() {
      ulong val = 7712059531;
      Console.WriteLine(val);
      // Max and Min values
      Console.WriteLine(ulong.MaxValue);
      Console.WriteLine(ulong.MinValue);
      // typeof
      Console.WriteLine(typeof(ulong));
   }
}

Output

7712059531
18446744073709551615
0
System.UInt64

Updated on: 22-Jun-2020

538 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements