AGE IN FIVE YEARS

Description:

Robot needs to ask user for their name. Then display their name to prove that you can recall it. Ask them for their age. Then display what their age would be five years from now. Then display what was their age five years ago. Test Case 1 Input (stdin) John 29 Expected Output In five years you will be 34 years old! Five years ago you were 24 years old! Imagine that! Test Case 2 Input (stdin) Roy 35 Expected Output In five years you will be 40 years old! Five years ago you were 30 years old! Imagine that!

Program :

#include <iostream>

using namespace std;

int main()

{

char a[10];

  int b;

cin>>a;

  cin>>b;

  cout<<"In five years you will be "<<(b+5)<<" years old!";

  cout<<"\nFive years ago you were "<<(b-5)<<" years old!";

  cout<<"\nImagine that!";

return 0;

}