-
end result:
this program show at the last thread of the second page may encountered runtime error...as you input two numbers, the answer is not correct...is there something wrong with the program or the code?
example:
num1=3
num2=5
product=1549
it should be:
num1=3
num2=5
product=15
-
Changes in red
Code:
// This program based on the old version of BORLAND C++
#include <iostream.h>
#include <conio.h>
int main()
{
int x;
int y;
int product = 0;
cout<<"input first number:";
cin>>x;
cout<<"input second number:";
cin>>y;
for(int i=0; i<x; i++)
{
product +=y;
}
cout<<"Product is:"<<product;
getch();
return 0;
}
-
conclusion
therefore, this program satisfies the problem...to all users behind it who help to solve...thank you....