Age Calculator C Program

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


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)
    	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


C Program For Age Calculator Application

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.

Tushar Soni

I am Tushar Soni, Co - Founder of CodingAlpha. I am a computer science student from India and passionate about Web Development and Programming. Connect with me on Facebook | LinkedIn | Google Plus

3 thoughts on “Age Calculator C Program

  • July 25, 2016 at 2:30 am

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

    • July 31, 2016 at 7:53 pm

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

  • August 21, 2016 at 12:05 pm

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


Join The Discussion