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
Why we use void main in c?
What is bin sh c?
What is main function in c?
Where is c used?
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
Write a program to reverse a linked list in c.
What is define c?
Explain what is the heap?
How can type-insensitive macros be created?
How many loops are there in c?
What are compound statements?
What does int main () mean?
Differentiate between null and void pointers.
Why is void main used?
Why do we use c for the speed of light?