if u want to find all end of month sat. sun of whole year .
start with first day of year .
1.Find out DATE of first saturday of month.
2.keep on adding 7 to its date and keep on checking with with no. of days left for End month .
if its less than 7 and Gr than 0 then we are at end sat and sun,
if its more than 7 then add 7 go to start of loop again .
it its equal to zero (sat is itself last day of month )
then we can subtract 6 and get last sun .
but for this code u need to cal. no. of days in that month in advance .
then only u can compare .