# Age Calculator C Program

By | July 24, 2016

## C Program To Make Age Calculator Application

Learn How To Make Age Calculator Application in C Programming Language. This C Program To Find Present Age of a Person takes in the Current Date and the Birth Date as Inputs from the User. It is a simple Program To Calculate Current Age of a Person by using Addition and Subtraction Operators. This C Program will calculate the age in Years, Months and Days.

Must Read: C Program To Run Live Digital Clock

#### C Program To Find Age of a Person

```#include<stdio.h>
#include<stdlib.h>

int current_date, birth_date, calculated_date, current_month, birth_month, calculated_month, current_year, birth_year, calculated_year;

void year(int current_date, int current_month, int current_year, int birth_date, int birth_month, int birth_year)
{
if(birth_date > current_date)
{
current_month = current_month - 1;
current_date = current_date + 30;
}
if(birth_month > current_month)
{
current_year = current_year - 1;
current_month = current_month + 12;
}
if(birth_year > current_year)
{
exit(0);
}
calculated_date = current_date - birth_date;
calculated_month = current_month - birth_month;
calculated_year = current_year - birth_year;
printf("\nPresent Age\nYears: %d\tMonths: %d\tDays: %d\n",calculated_year, calculated_month, calculated_date);
}

int main()
{
printf("\nEnter Current Date Details (In Numerical Figures)\n");
printf("Enter Today's Date:\t");
scanf("%d", &current_date);
printf("Enter Current Month:\t");
scanf("%d", &current_month);
printf("Enter Current Year:\t");
scanf("%d", &current_year);
printf("\nEnter Your Birth Details (In Numerical Figures)\n");
printf("Enter Day:\t");
scanf("%d", &birth_date);
printf("Enter Month:\t");
scanf("%d", &birth_month);
printf("Enter Year:\t");
scanf("%d", &birth_year);
year(current_date, current_month, current_year, birth_date, birth_month, birth_year);
return 0;
}```

Must Read: C Program To Print Map of India

#### Output

If you have any compilation errors or doubts in this C Program To Make Age Calculator Application, let us know about it in the Comment Section below.

## 6 thoughts on “Age Calculator C Program”

1. Vilas Kadam

Thank you so much. I was waiting for these kinds of programs.

1. Tushar Soni Post author

Happy that you liked the C Program to calculate age of a person.

2. शंकर पृसाद

आपका बहुत शुकृर्या। एेसे सी पृरोग्रआम की बहुत जरूरत थी।

3. Anjali Wadegaonkar

Is it possible to find the difference in birth time along with the date of birth calculator in c program?

4. Azhar Mehboob

Logic behind if statements…..

5. Herbert San

I have a function’print’should have prototype error how I get solve from this problem please tell fast its urgent