The code is below and from this sites tutorials. It is a multiplication program. But it has bugs, if I type a letter it will crash or make some error, likewise if I type a large number it will have problems. Isn't there someway to get it to output an error message and ask me to try again?
#include <iostream.h>
int mult(int x, int y);
int main()
{
int x, y;
cout<<"Please input two numbers to be multiplied: ";
cin>>x>>y;
cout<<"The product of your two numbers is "<<mult(x, y);
return 0;
}
int mult(int x, int y)
{
return x*y;
}