C Program To Multiply Two Numbers Without Using Arithmetic Operator

Posted on by admin

Suppose you want to divide a number a by another number b in java, you will use a / b. So simple, isn’t it.

  1. Divide Two Numbers Without Using Arithmetic Operators

But what if you are required to determine the result by using only minus(-) operator, that is, without using division (/) operator.TermsFollowing are the common terms used in division of numbersDividend: The number which is divided.Divisor: The number which divides another number.Remainder: Number which is left as a result of division.Quotient: Number which is obtained by dividing one digit with another.For Example, in the division of 13 is divided by 4 (13/4), 13 is the dividend, 4 is the divisor, 1 is the remainder and 3 is the quotient. LogicDivision of two numbers is a repeated subtraction of dividend and divisor till the dividend becomes less than the divisor.In every step,. the divisor is subtracted from the remainder of previous step.

El hombre pujols. the remainder of the subtraction is treated as the dividend of the next step.These steps are carried out till the difference of any step(or dividend of next step) becomes less than the divisor. At the end, the digit which is left finally is the remainder and the number of steps carried out is the quotientIt can be observed that in all steps the divisor(or the number which is subtracted) remains the same, only the dividend keeps on changing. The approach will not work and will give unexpected result in case either divisor or dividend is negative. There is a way out to resolve this problem. Since, in division, we are only concerned with the quotient and remainder and the numeric values of the divisor and dividend. Thus, if your input can contain negative numbers, then before starting the division process, check for negative values and convert them to positive numbers by multiplying them with -1.

Divide Two Numbers Without Using Arithmetic Operators

C Program To Multiply Two Numbers Without Using Arithmetic Operator

This will have no effect on the result.

This question and its answers are because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.Is it possible to write a C program that multiplies two numbers without using the multiplication and addition operators?I found. Please help this poor programmer with his problem. And please don't give answers like c = a/(1/((float)b)), which is exactly the same as c = a.b. (And is already given as an answer.)The answer with the most upvotes on January 19th 2014 wins.Note: This is a question. Please do not take the question and/or answers seriously.

Two

More information is in.