How to check the age by using birth date in C?

I’m new in C, and I would like to check the age of the user by input of birthday such as yymmdd,if more than 18 years old, then will proceed else will terminate the program. But i have try many time, it does not work. Can anyone help? Thanks in advance.