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 firstname.lastname@example.org. 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 standard error of mean
- Program to implement Linear Extrapolation
- Program to implement Collatz Conjecture
- Program to implement Simpson's 3/8 rule
- Program to implement ASCII lookup table
- Program to implement standard deviation of grouped data
- Program to implement Inverse Interpolation using Lagrange Formula
- Arithmetic Mean
- Division without using '/' operator
- Operator Overloading in C++
- Arithmetic Progression
- Arithmetic Number
- Addition of two number using '-' operator
- Operator Functions in Python | Set 1
- Ternary Operator in Python
Improved By : Mithun Kumar