Subtract Two Numbers without Arithmetic Operator C Program

By | October 18, 2016

Let us learn how to subtract two numbers without using subtraction () operator in C programming language.

We generally use the minus operator () to subtract one number from another. Here, we shall use the postfix decrement operator to find the product of the numbers. Alternatively, two numbers can be subtracted using Bitwise Operators.

Alternatively, two numbers can be subtracted using Bitwise Operators.

The first code to find the subtraction of two numbers without using subtraction operator () makes use of the postfix () operator. If you want to subtract two integers without arithmetic operators, then you will have to use the

If you want to subtract two integers without arithmetic operators, then you will have to use the bitwise operators which is demonstrated in the second program by using Bitwise Shift Operators.

C Program To Subtract Two Numbers without using Subtraction Operator

C Program To Subtract Two Numbers using Bitwise Operators

Output

C Program To Subtract Two Numbers without using - Operator and using Bitwise Operators

If you have any compilation error or doubts in this C program to subtract two integers using Bitwise Operators, let us know about it in the comment section below.

RECOMMENDED PROGRAMS
C Program To Add Two Integers without using Arithmetic Operator
C Program To Divide Two Integers without using Arithmetic Operator
C Program To Multiply Two Integers without using Arithmetic Operator
C Program To Find Addition of Two Integers using Pointers
C Program To Subtract Two Integers using Pointers

Let's Discuss