I need to multiply two integers without using multiplication or division operators, any built in Multiply functions, or loops.
I have managed to do multiplication with with a loop, but I don't get how to do so without loops.
Here is my solution with a loop:
Public Double(Double x, Double y)
{
Double Result;
Result =0;
If(x==0 || y==0)
{
Result = 0;
}
else
{
for(int i=0; i<=y; i++)
{
Result = Result + x;
}
}
return Result;
}