How do I turn my problem to have suboutine. Not so sure how to do it.
#include <iostream>
using namespace std;
int main()
{
int x,y,z;
cout << "Please enter first number: ";
cin >> x;
cout << "Please enter second number: ";
cin >> y;
z = x + y;
cout << "Answer is \n" << z;
return 0;
}