The specification is very unclear.
2) Whichever calendar, the day of birth determines the day of week; there is no guarantee that it will be Saturday.
Anyway, below is a solution for some arbitrary disambiguation of the specifications.
// Return true if the first date is before the second date
bool isBefore(int day1, int month1,
int day2, int month2)
{
if (month1 < month2) return true;
if (month1 > month2) return false;
return (day1 < day2);
}
// Return number of days in give year according to Gregorian calendar.
// However, the problem statement may be refering to the Julian calendar.
// If so, you need to change this code.
int numDays(int year)
{
if (year % 400 == 0) return 366;
if (year % 100 == 0) return 365;
if (year % 4 == 0) return 366;
return 365;
}
// If the given date falls before February 29 then any insertion of leap day
// would be determined by the current year.
// Otherwise it would be determined by the next year.
int numDaysToNextBirthday(int day, int month, int year)
{
if (isBefore(day, month, 2, 29)) return numDays(year);
else return numDays(year+1);
}
////////////////////////////////////////////////////////////////////////
// MAIN CODE
// Days of the week are represented (arbitrarily) as
// 0: Sunday
// 1: Monday
// ...
// 6: Saturday
int dayOfWeek = 6; // Given that born on Saturday
int numBirthdaysOnMonday = 0; // the final result to be calculated
// Set endYear to the last year when birthday will be selebrated.
// If he dies on his birthday, assume that he does not selebrate his birthday
int endYear = isBefore(XX, YY, AA, BB) ? CCCC : CCCC-1;
int year; // iterates over each year since birth
for (year = ZZZZ; // start with the year born
year < endYear; // end with the year before the last birthday
year++) {
// Calculate the day of the week on which the next birthday will fall
dayOfWeek = (dayOfWeek + numDaysToNextBirthday(XX, YY, year)) % 7;
// If it is Monday, count it
if (dayOfWeek == 1) numBirthdaysOnMonday++;
}