Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions Age_Calculator.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//Program to check your age till date
//Hello this is Rishabh Dhara,I have made a few changes.Look into it...


#include<iostream.h>
Expand All @@ -19,8 +20,18 @@ cout<<"\nEnter The Current Month(Eg:12): ";
cin>>current_month;
cout<<"\nEnter The Current Year(Eg:2020): ";
cin>>current_year;
ageinyear= ;
ageinmonth= ;
if(birth_month>=current_month)
{
ageinyear=current_year-birth_year ;
ageinmonth=current_month-birth_month;
}
else
{
current_month=12+current_month;
current_year=current_year-1;
ageinmonth=current_month-birth_month;
ageinyear=current_year-birth_year;
}
cout<<"\n\nYour Age is "<<ageinyear<<" Years And "<<ageinmonth<<" Months ";
getch();
}