a c++ program that multiply two integers without using multiply operator.

ahmad mohsin's Avatar, Join Date: Mar 2010
Newbie Member
Please Help
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
How far have you got and where are you stuck? Do you know how to multiply without using a multiply? (Hint: What is 10^(log a + log b), using log base 10)
0
techgeek.in's Avatar, Join Date: Dec 2009
Skilled contributor
try this:-
Code:
# include<iostream.h>
# include<math.h>
int main()
{
int i,j;
double temp1,temp2,k;
cin>>i>>j;
temp1=log10(i);
temp2=log10(j);
k=pow(10,temp1+temp2);
cout<<k;
}