write a program to swap Two numbers without using temp variable.
Answer Posted / ajith c.k
#include"stdio.h"
int swap(int *,int*);
int main()
{
int a,b;
printf("enter two number");
scanf("%d%d",&a,&b);
swap(&a,&b);
printf("%d\t%d",a,b);
return ;
}
int swap(int *s,int *q)
{
if(*s==*q)
return;
*s^=*q;
*q^=*s;
*s^=*q;
return ;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
When should structures be passed by values or by references?
will u please send me the placement papers to my mail???????????????????
What is 2c dna?
What is function definition in c?
Explain the difference between #include "..." And #include <...> In c?
What is c language used for?
In c language can we compile a program without main() function?
Why is extern used in c?
What is the size of empty structure in c?
What is declaration and definition in c?
What is an lvalue?
Explain what is a static function?
How can I generate floating-point random numbers?
Explain how can I make sure that my program is the only one accessing a file?
What are qualifiers in c?