type float, double and decimal difference in datatype in c#.

CODE:

  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

Popular posts from this blog

Vertical and Reverse Paramid in c# using loop.

Calculator in c# using Static Methods

Calculator in c# using Method void method