Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // pseudo-code function for grabbing the years elapsed
- // from the day, month and year given
- // probably not the most efficient way to do it but it works
- get_age()
- {
- day = 1;
- month = 5;
- year = 1992;
- age = 0;
- for(i = year; i < current_year; i++)
- {
- age++;
- }
- if(month > current_month)
- {
- age--;
- }
- elseif(month == current_month)
- {
- if(day > current_day)
- {
- age--;
- }
- }
- return age;
- }
Advertisement
Add Comment
Please, Sign In to add comment