डेसीमल प्रकार में न्यूनतम और अधिकतम मान प्राप्त करने के लिए स्थिरांक हैं।
एक डेसीमल मान सेट करें:
decimal d = 5.8M;
डेसीमल प्रकार के न्यूनतम और अधिकतम मान प्राप्त करने के लिए, निम्नलिखित प्रॉपर्टीज का उपयोग करें:
decimal.MaxValue decimal.MinValue
यहाँ पूरा कोड है:
उदाहरण
using System; using System.Linq; class Demo { static void Main() { decimal d = 5.8M; Console.WriteLine(d); Console.WriteLine("अधिकतम मान: "+decimal.MaxValue); Console.WriteLine("न्यूनतम मान: "+decimal.MinValue); } }आउटपुट
5.8 अधिकतम मान: 79228162514264337593543950335 न्यूनतम मान: -79228162514264337593543950335