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
Explain how do you convert strings to numbers in c?
Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)
Why can’t we compare structures?
What does it mean when the linker says that _end is undefined?
Write a code to generate a series where the next element is the sum of last k terms.
can we have joblib in a proc ?
Is int a keyword in c?
What's the total generic pointer type?
Where does the name "C" come from, anyway?
Why c is called a middle level language?
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?
Why main function is special give two reasons?
Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.