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
What does the error message "DGROUP exceeds 64K" mean?
Whats s or c mean?
p*=(++q)++*--p when p=q=1 while(q<=6)
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
What is calloc() function?
What is a macro in c preprocessor?
In C language, a variable name cannot contain?
Combinations of fibanocci prime series
What is && in c programming?
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
Where register variables are stored in c?
When is a void pointer used?
Where we use clrscr in c?
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
What are reserved words with a programming language?