I have a simple little program that I created to test a funtion that best goes back to the beginning of the code from the end. Any ideas?
Heres just a simple program:
Code:
#include "stdafx.h"
#include <iostream>
int ReadNumber()
{
using namespace std;
cout <<" Welcome to Jake's Calculator, enter in two numbers to be computed" << endl;
cout <<" Answers will be shown in this form: Add, Subtract, Multiply, and Divide." << endl;
cout <<" Enter numbers to calculate:" << endl;
int x;
cin >> x;
return x;
}
void WriteAnswer(int x)
{
using namespace std;
cout <<"The answer is " << x << endl;
}
int main()
{
int x = ReadNumber();
int y = ReadNumber();
WriteAnswer(x+y);
WriteAnswer(x-y);
WriteAnswer(x*y);
WriteAnswer(x/y);
system("pause") // What to do from here to loop to top?
return 0;
}