this code for multiplying 2 numbers without using *.
Is my code optimised or need some changes
@chirag.goel360 you can reduce the number of calls for this by making the c the smaller number. for eg if we have to calculate 5 * 100, it is more efficient to add 100, 5 times instead of 5, 100 times.
mam i have checked it as firstly i am calling(min,max) which will led to 100+100+100+100+100
i want to know whether i can get rid of those if else statements in main functions
@chirag.goel360
you can use ternary operator like this
c = a < 0 ? -a : a;
d = b < 0 ? -b : b;
instead of what you are doing right now