01 April 2017

centuryFromYear

My solution:
int centuryFromYear(int year)
{
    return year % 100 == 0 ? year / 100 : year / 100 + 1;
}

Previous Next