
how can i write a program to swap a value without using any arithmetic or any other third variable???
and also for adding two numbers without using any arithmetic operator??????? in c language

Hello Friend,
1)For swapping, use following code:
int num1=5,num2=10;
num1 = num1 + num2;
num2 = num1 - num2;
num1 = num1 - num2;
2)Add 2 Numbers:
#include<stdio.h>
#include<conio.h>
int main()
{
int num1,num2,sum;
printf("\nEnter 1st number for addition:");
scanf("%d",&num1);
printf("\nEnter 2nd number for addition:");
scanf("%d",&num2);
char *p;
p=(char *)num1;
sum= (int)&p[num2]; //sum of num1 and num2
printf("\nSum of %d and %d is %d",num1,num2,sum);
getch();
return 0;
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.