 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP 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
Get the hash code for the current Decimal instance in C#
To get the hash code for the current Decimal instance, the code is as follows −
Example
using System; public class Demo {    public static void Main(){       Decimal val = 135269.38193M;       Console.WriteLine("Decimal Value = {0}", val);       Console.WriteLine("HashCode = {0}", (val.GetHashCode()) );    } }  Output
This will produce the following output −
Decimal Value = 135269.38193 HashCode = 1328665595
Example
Let us now see another example −
using System; public class Demo {    public static void Main(){       Decimal val = Decimal.MaxValue;       Console.WriteLine("Decimal Value = {0}", val);       Console.WriteLine("HashCode = {0}", (val.GetHashCode()) );    } }  Output
This will produce the following output −
Decimal Value = 79228162514264337593543950335 HashCode = 1173356544
Advertisements
 