diff --git a/Age_Calculator.cpp b/Age_Calculator.cpp index 6be2102..369b8b8 100644 --- a/Age_Calculator.cpp +++ b/Age_Calculator.cpp @@ -1,26 +1,25 @@ //Program to check your age till date -#include -#include -void main() +#include +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 "<> 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 "; }