I was just going through some basic stuff as I am learning C. I came upon a question to multiply a number by 7 without using the * operator. Basically it\'s like this
int multiply(int multiplicand, int factor) { if (factor == 0) return 0; int product = multiplicand; for (int ii = 1; ii < abs(factor); ++ii) { product += multiplicand; } return factor >= 0 ? product : -product; }
You wanted multiplication without *, you got it, pal!
*