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
How to create struct variables?
Explain what is wrong with this statement? Myname = ?robin?;
An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array
Explain how can I open a file so that other programs can update it at the same time?
What are the rules for the identifier?
How to find a missed value, if you want to store 100 values in a 99 sized array?
What is a buffer in c?
What are reserved words?
What are enums in c?
What do you mean by keywords in c?
Can the sizeof operator be used to tell the size of an array passed to a function?
I need testPalindrome and removeSpace
#include
Explain how do you declare an array that will hold more than 64kb of data?
What does a function declared as pascal do differently?
Can include files be nested? How many levels deep can include files be nested?