Way 1 : Using Recursive Function
#include<stdio.h>
#include<conio.h>
int add(int,int);
void main()
{
int a,b;
clrscr();
printf("Enter the two Numbers: ");
scanf("%d%d",&a,&b);
printf("Addition of two num. is : %d",add(a,b));
getch();
}
//-----------------------------------------------
int add(int a, int b)
{
if (!a)
return b;
else
return add((a & b) << 1, a ^ b);
}Way 2 : Using While Loop
#include<stdio.h>
#include<conio.h>
void main()
{
int a=10,b=5,i;
clrscr();
while(b>0)
{
a++;
b--;
}
printf("%d",a);
getch();
}Way 3 : Using While Loop
#include<stdio.h>
#include<conio.h>
void main()
{
int a=10,b=5;
while(b--)
a++;
printf("Sum is : %d" a);
}Way 4 : Using For Loop
#include<stdio.h>
#include<conio.h>
int sum(int,int);
void main()
{
int a,b;
clrscr();
printf("Enter the two Numbers: ");
scanf("%d%d",&a,&b);
printf("Addition of two num. is : %d",add(a,b));
getch();
}
int add(int num1,int num2)
{
int i;
for(i=0;i< num2;i++)
num1++;
return num1;
}Way 5 : Using Subtraction
#include<stdio.h>
#include<conio.h>
void main()
{
int a=10,b=5;
a = a-(-b);
printf("Sum is : %d" a);
}Note : This Example have Arithmetic Operator [-] but this example is for “Adding two numbers without using + Operator “
Incoming search terms:
- a c program for subtracting two numbers using bitwise operators (1)
- how to add numbers in c programing (1)
- how to add two numbers using bitwise in c (1)
- how to add two numbers without arithmetic operators in c (1)
- how to add two numbers without using arithmetic operators or any loop (1)
- how to add two numbers without using arithmetic operators? (1)


