Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

Printing months in a year in three letter format in C#

The format MMM will give the months name in three letter format.


using System;

namespace forgetCode
{
    class Program
    {
        static void Main(string[] args)
        {
            DateTime now = DateTime.Today;
            for (int i = 0; i < 12; i++)
            {
                Console.WriteLine(now.ToString("MMM"));
                now = now.AddMonths(1);
            }          
        }

    }
}


Output:
Jul
Aug
Sep
Oct
Nov
Dec
Jan
Feb
Mar
Apr
May
Jun

..