type float, double and decimal difference in datatype in c#.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace simple_calculator
{ class Program
{
static void Main(string[] args)
{
float A = 5;
Console.WriteLine("{0}",A);
double B = -5.01 ;
Console.WriteLine("{0}", B);
double C = 34.567839023 ;
Console.WriteLine("{0}", C);
double D = 12.345;
Console.WriteLine("{0}", D);
double E = 8923.1234857;
Console.WriteLine("{0}", E);
decimal F =
3456.091124875956542151256683467M ;
Console.WriteLine("{0}", F);
}
}
}
output:
Comments
Post a Comment