Posted by : Sudhir Chekuri Thursday, 31 December 2015

Predefined methods are the inbuilt methods we have in C#.NET which do something or returns a value.
We have predefined methods like

minvalue( )

min value is a method used to find out the minimum value a numeric datatype can store.
It is only for numeric types.

maxvalue( )

max value is a method used to find out the maximum value a numeric datatype can store.
It is only for numeric types.

Example program to print minvalue and maxvalue of numeric datatypes int, uint, long, float, double, decimal
Program


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace min_max_value
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(int.MinValue);
Console.WriteLine(int.MaxValue);
Console.WriteLine(uint.MinValue);
Console.WriteLine(uint.MaxValue);
Console.WriteLine(long.MinValue);
Console.WriteLine(long.MaxValue);
Console.WriteLine(float.MinValue);
Console.WriteLine(float.MaxValue);
Console.WriteLine(double.MinValue);
Console.WriteLine(double.MaxValue);
Console.WriteLine(decimal.MinValue);
Console.WriteLine(decimal.MaxValue);
Console.ReadKey();
}
}
}

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Followers

Total Pageviews

Powered by Blogger.

Blog Archive

- Copyright © 2013 DevStudent - Metrominimalist - Powered by Blogger - Designed by Johanes Djogan -