Given two numbers, perform multiplication, subtraction and division operations on them, using ‘+’ arithmetic operator only.
Operations can be performed as follows:
Subtraction :- a - b = a + (-1)*b. Multiplication :- a * b = a + a + a ... b times. Division :- a / b = continuously subtract b from a and count how many times we can do that.
The above steps look simple, but it is slightly challenging as we can’t even use – to subtract.
Subtraction is 6 Product is -54 Division is 4
Related Articles :
- Add two numbers without using arithmetic operators
- Subtract two numbers without using arithmetic operators
- Multiply two integers without using multiplication, division and bitwise operators, and no loops
This article is contributed by Sakshi Tiwari. If you like GeeksforGeeks (We know you do!) and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Program to implement Simpson's 3/8 rule
- Program to implement Collatz Conjecture
- Program to implement Linear Extrapolation
- Program to implement standard error of mean
- Program to implement ASCII lookup table
- Program to implement standard deviation of grouped data
- Program to implement Inverse Interpolation using Lagrange Formula
- Arithmetic Mean
- Arithmetic Progression
- Arithmetic Number
- Division without using '/' operator
- Operator Overloading in C++
- Subtract 1 without arithmetic operators
- Find N Arithmetic Means between A and B
- How to sum two integers without using arithmetic operators in C/C++?
Improved By : Mithun Kumar