void swap(int a,int b)
{
a=a+b;
b=a-b;
a=a-b;
}
in this code always gives the same result for all case
Answer Posted / shouvik mitra
This code gives the interchange values of the two variables.But this code can also give the same result for the two variables when same numbers are inputted in both the variables, i.e. say a=5,b=5.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is variables in c?
What does == mean in texting?
Explain the ternary tree?
Why clrscr is used in c?
Why is c called a mid-level programming language?
How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
explain what is an endless loop?
Explain goto?
What is n in c?
What are the types of i/o functions?
What is wrong in this statement? scanf(ā%dā,whatnumber);
What is function what are the types of function?
What are register variables? What are the advantage of using register variables?
Explain main function in c?
Can a variable be both static and volatile in c?