FORMAT SPECIFIERS IN C# PROGRAM.

 FORMAT SPECIFIERS:

OUTPUT:


CODE:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;


namespace Format_Specifiers

{

    class Program

    {

        static void Main(string[] args)

        {

            DateTime dt = DateTime.Now;

             Console.WriteLine("Date-Time:{0}",dt);

             int i = 1235;

             Console.WriteLine("{0:C}",i);

             Console.WriteLine("{0:D2}", i);

             Console.WriteLine("{0:E}", i);

             Console.WriteLine("{0:F}", i);

             Console.WriteLine("{0:G}", i);

             Console.WriteLine("{0:N}", i);

             Console.WriteLine("{0:P}", i);

             Console.WriteLine("{0:X}", i);

             Console.ReadLine();


         

            

        }

    }

}



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