Multiply without using multiplication operator in C and C++

Spread the love

C Program to multiply positive integers x and y by using addition and subtraction operators only. Means¬†multiply without using multiplication operator. Let’s start.

Algorithm:

  1. Take the input from the user and store them in x and y.
  2. Now create a for loop, That will loop from 1 to the y.
  3. For each iteration, we are going to add x to mul. Mul is variable which is initially 0 and we are adding x to mul. Means we are multiplying the value.
  4. This process will repeat until we reach the y. Once we reach, Loop will break and Multiplication value is stored in variable mul
  5. Display the mul value on the console.

Program :

Output:

muliplying without using multiplication operator in C and C++

 

 

Venkatesh Macha

Hi Guys, I am Venkatesh Macha. Founder of SillyCodes. I am a programmer, Presently working as a Software Engineer in Hyderabad. I love Linux and Open Source. Apart from that, I love to explore new technologies and things.

You may also like...

Leave a Reply