Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Implicit conversion from UInt64 to Decimal in C#
The ulong type represents a 64-bit unsigned integer i.e. UInt64.
To implicitly convert a 64-bit unsigned integer to a Decimal, firstly set UInt64 value.
ulong val = ulong.MaxValue;
To convert ulong to decimal, assign the value.
decimal dec; dec = val;
Let us see the above example.
Example
using System;
public class Demo {
public static void Main() {
ulong val = ulong.MaxValue;
decimal dec;
Console.WriteLine("Implicit conversion from Ulong to Decimal");
dec = val;
Console.WriteLine("Decimal : "+dec);
}
}
Output
Implicit conversion from Ulong to Decimal Decimal : 18446744073709551615
Advertisements