C# Century From Year
static int CenturyFromYear(int year)
{
return (int)Math.Ceiling(year / 100.0);
}
This converts a year into its century. Years 1-100 are century 1, 101-200 are century 2, and so on.
static int CenturyFromYear(int year)
{
return (int)Math.Ceiling(year / 100.0);
}
This converts a year into its century. Years 1-100 are century 1, 101-200 are century 2, and so on.