Write a program to interchange two variables without using
the third variable?
Answer Posted / vijay r15
using many ways we can
perform
#include<stdio.H>
void main()
{
int a=10,b=20;
b=a+b-(a=b);
//or use a^=b^=a^=b;
//or use a=a+b;b=a-
b;a=a-b;
//or use a^=b; b^=a;
a^=b;
printf("%d%d",a,b);
}
| Is This Answer Correct ? | 2 Yes | 5 No |
Post New Answer View All Answers
What is stack in c?
Lists the benefits of c programming language?
pierrot's divisor program using c or c++ code
Tell us something about keyword 'auto'.
What are logical errors and how does it differ from syntax errors?
What are the different file extensions involved when programming in C?
Give me the code of in-order recursive and non-recursive.
What are the types of macro formats?
How is a null pointer different from a dangling pointer?
Do you know the difference between malloc() and calloc() function?
Explain a file operation in C with an example.
What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
What are the loops in c?
What is the auto keyword good for?