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
Can the “if” function be used in comparing strings?
Explain the difference between ++u and u++?
Can a pointer be null?
write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?
Explain what is #line used for?
while initialization of array why we use a[][2] why not a[2][]...?
What is sizeof c?
What is local and global variable in c?
Can you return null in c?
What is #include stdio h?
What is a shell structure examples?
What is volatile keyword in c?
List the difference between a "copy constructor" and a "assignment operator"?
What are the 5 data types?
What is a pragma?