It sounds like what you need is an age calculator, and it doesn't need to deal with leap years or any other problem concepts.
What you are looking for right now is just difference. Let's start with exactly that:
date: 10/11/2016
birth date: 4/8/2012
result == 2016-2012 years, 11-8 months, 10-4 days
== 4 years, 7 months, 6 days
And so with 3 simple subtractions, 4 years, 7 months, 6 days is the result. This is the easy part, in fact we can always start with this simple subtraction, this is step 1.
Now let us consider another case:
date: 10/4/2016
birth date: 21/9/2001
== 15 years, -5 months, -11 days
What we have is still technically correct, but you probably don't want negatives in your answer. There is a really easy fix to this: a year is the next unit up from months, so we can just move one year to the months column (this should look familiar, think back to grade 6 math).
15y,-5m -11d
== 14y, -5m+12m, -11d
== 14y, 7m, -11d
Starting to see how this works? The last and hardest step is the days. Because there is variation in number of days between month, we need to check how many days were in the current month. In your code you use month[], so I will use this array name:
14y, 7m, -11d
== 14y, 6m, -11d+month[7-1]
== 14y, 6m, -11d+31d
== 14y, 6m, 20d
And there you have your final answer, 14 years, 6 months, 20 days. There is only one case in which you could get a negative age now, and that is when the birth date entered is after the current date; you can choose to handle that however you like. There is one more case that could give you issues using this algorithm: you could get 0s. I will let you figure that out though, because I don't want to do all of your work for you here.
So to sum everything up:
- Subtract the birth date from the current date
- If the resultant months are negative, add 12 and subtract 1 from the resultant years
- If the resultant days are negative, add month[resultant months-1] days to them, and subtract 1 from resultant months
Good luck, hopefully this explains things well enough.