Subtract Two Numbers without Arithmetic Operator C Program

C Program To Subtract Two Numbers without Subtraction Operator

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 For Addition of Two Numbers without using + Operator
C Program To Raise Positive Integer to Power
C Program For Multiplication of Two Numbers without * Operator
C Program For Division of Two Numbers without using / Operator
 C Program To Print Tribonacci Series
 C Program To Compare Two Strings
 C Program To Find Sum of Digits of Number using Recursion
 C Program To Solve Simpsons Rule

Let's Discuss