FORMAT SPECIFIERS IN C# PROGRAM.
FORMAT SPECIFIERS:
OUTPUT:
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
Post a Comment