About 16,800,000 results
Open links in new tab
  1. Product of 2 Numbers using Recursion - GeeksforGeeks

    Mar 17, 2025 · To find the product of two numbers x and y using recursion, you can use the following approach: Base Case: If y=0, return 0 (since any number multiplied by 0 is 0). Recursive Case: Add x to result and make a recursive call with y as y-1.

  2. Multiplication of two numbers with shift operator

    Sep 12, 2023 · For any given two numbers n and m, you have to find n*m without using any multiplication operator. We can solve this problem with the shift operator. The idea is based on the fact that every number can be represented in binary form. And multiplication with a number is equivalent to multiplication with powers of 2.

  3. Multiplication algorithm - Wikipedia

    A multiplication algorithm is an algorithm (or method) to multiply two numbers. Depending on the size of the numbers, different algorithms are more efficient than others. Numerous algorithms are known and there has been much research into the topic.

  4. Multiply two integers without using multiplication, division

    Sep 19, 2022 · Given two integers a and b, the task is to find the quotient after dividing a by b without using multiplication, division, and mod operator. Note: If the quotient is strictly greater than 231 - 1, return 231 - 1 and if the quotient is strictly less than -231, then return -231.

  5. bit - Algorithm for multiplying two numbers - Stack Overflow

    Jan 9, 2016 · One simple way is to add x , y times OR add y, x times which is simple enough and is linear. Second way is to pick any number (say x) and see which all bits are set in that number and if ith bit is set just do this: product +=y<<i//product is 0 initially and do this for all i.

  6. Multiply two numbers in C (with algorithm) - ReadMeNow

    Algorithm to multiply two numbers in C: 1) Start. 2) Accept Number one. 3) Accept Number two. 4) Multiply both the numbers. 5) Print the result. 6) End. Program to multiply two numbers in C:

  7. c - How to multiply 2 numbers using recursion - Stack Overflow

    Oct 20, 2018 · I'm trying to multiply (3, 6) and (9, 9) using recursion. However, the result printed is 18 and 45. I need to find out which part is wrong. Here's my code: int a, b, c; a = 6; b = 3; c = multiply(a, b); printf("%d\n", c); a = 9; b = 9; c = multiply(a, b); printf("%d\n", c); return 0; static int c = 0, i = 0; if (i < a) { c = c + b; i++;

  8. An algorithm to calculate the multiplication and division of any …

    Mar 15, 2023 · Calculate their product [Product = num1 * num2]: Multiply the first number by the second number to get the product. Calculate their quotient [Quotient = num1 / num2]: Divide the first number by the second number to get the quotient.

  9. Algorithm to find multiplication of two numbers - YouTube

    write an algorithm to get multiplication of two numbers#multiplication #jischolars

  10. Three algorithms for integer multiplication — Python - a …

    With this we can implement the school algorithm for multiplication: def school_mul ( m , n ): lines = [ None ] * len ( n ) for i in reversed ( range ( len ( n ))): lines [ i ] = digit_times_number ( n [ i ], m ) + [ 0 ] * ( len ( n ) - 1 - i ) sum = [] for line in lines : sum = plus ( sum , line ) return sum

Refresh