write a program to swap Two numbers without using temp variable.
Answer Posted / yash paranjape
int main()
{
int a,b;
printf("enter the two numbers");
scanf("%d%d",&a,&b);
a^=b^=c^=a;//swap a and b
printf("%d%d",a,b);//numbers r swapped
}
| Is This Answer Correct ? | 82 Yes | 189 No |
Post New Answer View All Answers
What are the different types of pointers used in c language?
Describe how arrays can be passed to a user defined function
Write a program to reverse a given number in c language?
Why cant I open a file by its explicit path?
What is the most efficient way to count the number of bits which are set in an integer?
Explain what is the best way to comment out a section of code that contains comments?
Explain what is #line used for?
Once I have used freopen, how can I get the original stdout (or stdin) back?
What is the collection of communication lines and routers called?
Why c is known as a mother language?
Is a house a shell structure?
how can use subset in c program and give more example
What are integer variable, floating-point variable and character variable?
The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none
Write a program to show the change in position of a cursor using c