Add two Numbers without using + Operator in C
Here you will know and get the program code to add two numbers without using addition operator in c programming. We will try to make this program by using two different ways.
Program 1 – Add two Numbers without using Addition operator in C
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #include<stdio.h> main() { int a=10,b=20; int sum=0; fflush(stdin); while(a>=1) { a--; b++; } printf("\nSum = %d",b); } |
Output
Sum = 30
Program 2- Add two Numbers without using Addition operator in C
1 2 3 4 5 6 7 8 9 10 | #include<stdio.h> main() { int a=10,b=20; int sum=0; fflush(stdin); a = a - (-b); printf("\nSum = %d",a); } |
Output
Sum = 30
Check out our other C programming Examples