Finding LastDayofPreviousMonth, FirstDayofCurrentMonth, LastDayofCurrentMonth using a Given date

Using the below query we can get nth month’s Last Day of Previous Month,First Day of Current Month and Last Day of Current Month for any given date.
--Works in all SQL Versions
Select getdate() as CurrentDate,
dateadd(day,-day(getdate()),dateadd(month,n,getdate())) as [LastDayofPreviousMonth],
dateadd(day,-day(getdate())+1,dateadd(month,n,getdate())) as [FirstDayOfCurrentMonth],
dateadd(day,-day(getdate()),dateadd(month,n+1,getdate())) as [LastDayofCurrentMonth]

--Works in SQL 2012 and above
Select EOMonth(getdate(),n-1) as [LastDayofPreviousMonth],
DateAdd(day,1,EOMonth(getdate(),n-1)) as [FirstDayOfCurrentMonth],
EOMonth(getdate(),n) as [LastDayofCurrentMonth]

Example:
Select getdate() as CurrentDate,
dateadd(day,-day(getdate()),dateadd(month,2,getdate())) as [LastDayofPreviousMonth],
dateadd(day,-day(getdate())+1,dateadd(month,2,getdate())) as [FirstDayOfCurrentMonth],
dateadd(day,-day(getdate()),dateadd(month,2+1,getdate())) as [LastDayofCurrentMonth]

Dates#1

Select EOMonth(getdate(),2-1) as [LastDayofPreviousMonth],
DateAdd(day,1,EOMonth(getdate(),2-1)) as [FirstDayOfCurrentMonth],
EOMonth(getdate(),2) as [LastDayofCurrentMonth]

Dates#2