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
37 changes: 18 additions & 19 deletions Age_Calculator.cpp
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
//Program to check your age till date


#include<iostream.h>
#include<conio.h>
void main()
#include <iostream>
using namespace std;
int main()
{
int birth_month,birth_year;
int current_month,current_year;
int ageinyear,ageinmonth;
cout<<"Age Calculator\n\n";
int birth_month, birth_year;
int current_month, current_year;
int ageinyear, ageinmonth;
cout << "Age Calculator\n\n";

cout<<"\nEnter Your Birth Month(Eg:8): ";
cin>>birth_month;
cout<<"\nEnter Your Birth Year(Eg:1999): ";
cin>>birth_year;
cout << "\nEnter Your Birth Month(Eg:8): ";
cin >> birth_month;
cout << "\nEnter Your Birth Year(Eg:1999): ";
cin >> birth_year;

cout<<"\nEnter The Current Month(Eg:12): ";
cin>>current_month;
cout<<"\nEnter The Current Year(Eg:2020): ";
cin>>current_year;
ageinyear= ;
ageinmonth= ;
cout<<"\n\nYour Age is "<<ageinyear<<" Years And "<<ageinmonth<<" Months ";
getch();
cout << "\nEnter The Current Month(Eg:12): ";
cin >> current_month;
cout << "\nEnter The Current Year(Eg:2020): ";
cin >> current_year;
ageinyear = current_year - birth_year;
ageinmonth = 12 - birth_month;
cout << "\n\nYour Age is " << ageinyear << " Years And " << ageinmonth << " Months ";
}