I have made a "program" that just says welcome! Type two numbers you want to be added to each other: there you type the two numbers and then you get the answer out... When that is done it says: Press any key to continue . . . When you press a key the program shuts down, but I want it to restart when you pres any key... How do I do that? I use Microsoft visual studio express 2013 for windows desktop... langue is C++
This is my code:
#include <iostream>
#include <limits>
#include <cstdio>
using namespace std;
int Add(int x, int y)
{
cout << "Calculating the sum of " << x << " + " << y << "\n";
return (x + y);
}
int main()
{
cout << " Welcome!\n";
int a, b, c;
cout << "Type two numbers you want to be added to each other: ";
cin >> a;
cin >> b;
c = Add(a, b);
cout << "The answere is: " << c;
cout << "\nShutting down....\n\n";
system("pause");
return 0;
}