Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   a c++ program that multiply two integers without using multiply operator. (http://www.go4expert.com/forums/cpp-program-multiply-integers-using-t21349/)

ahmad mohsin 13Mar2010 19:35

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

xpi0t0s 14Mar2010 14:30

Re: a c++ program that multiply two integers without using multiply operator.
 
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)

techgeek.in 14Mar2010 16:49

Re: a c++ program that multiply two integers without using multiply operator.
 
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;
}



All times are GMT +5.5. The time now is 07:04.