Hello all, I've just started to learn C++ since I have a bit of time on my hands. I was doing an exercise, learning functions and built a multiplier (very basic, enter 2 numbers and here is the result) strange thing, if the numbers you enter are very high, I get this: the product of your two numbers is 373441392, is there a reason it's this number, anyone know?
#include <iostream>
using namespace std;
int mult ( int x, int y );
int main()
{
int x;
int y;
cout<<"Please input two numbers to be multiplied (separated by a space) : ";
cin>> x >> y;
cin.ignore();
cout<<"The product of your two numbers is "<< mult ( x, y ) <<"\n";
cin.get();
}
int mult ( int x, int y )
{
return x * y;
}