using System;
public class Program
{
public static void Main()
var startOfLastMonth = DateTime.Today
.AddDays(-DateTime.Today.Day+1)
.AddMonths(-1);
Console.WriteLine(startOfLastMonth);
startOfLastMonth = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1)
}