Answer to Question #258498 in C++ for Angelie Suarez

Question #258498

In C++ create a code that Asks for a birth date then compute and display the exact age in a year


1
Expert's answer
2021-10-30T00:40:52-0400
#include <iostream>


using namespace std;


int main()
{
    int currentYear;
    int birthYear;
    int age;
    cout<<"\nEnter current year: ";
    cin>>currentYear;
    cout<<"\nEnter birth year: ";
    cin>>birthYear;
    
    age=currentYear- birthYear;
    cout<<"Age = "<<age<<" years";
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS