#include <iostream>
usingnamespace std;
int main()
{
int num1,num2,product,counter=1;
cout<<"Enter amount of numbers to be multiplied in between 1 and 10 : "<<endl;
cin>>num1;
cout<<"Enter the numbers to be multiplied : "<<endl;
cin>>num2;
while(counter<=num1)
{
cin>>num2;
product=num2*num2;
counter++;
}
cout<<product;
return 0;
}
The problem is that you multiply num2 with itself. This way, if you for example put in 7 and 8 you'll get product =7*7(=49) and in the second run product =8*8(=64). The programm will then print 64 instead of 56 to the screen. To fix this you need to multiply product with num2 (but make sure to initialise product with 1, else you'll get 0 as a result).
The second small mistake is that you cin>>num2 before your while-loop which will give the user the impression as if he multiplied e.g. 4 and 5, whereas he multiplied 1 and 5 because the 4 was overwritten by his second input to fix this you could either delete that line, or let the user enter product before the lopp and num2 in the loop body.