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 / k.kavitha
NO,if the values of a&b are 10,20 respectively., Then
a=a+b becomes "a=30"
b=a-b becomes b=30-20 i.e., "b=10"
a=a-b gives a=30-10 i.e., "a=20"
| Is This Answer Correct ? | 20 Yes | 6 No |
Post New Answer View All Answers
Define and explain about ! Operator?
In C programming, how do you insert quote characters (‘ and “) into the output screen?
Explain how do you convert strings to numbers in c?
Hai what is the different types of versions and their differences
What do you mean by recursion in c?
Can the “if” function be used in comparing strings?
Is sizeof a keyword in c?
What is the size of enum in c?
Dont ansi function prototypes render lint obsolete?
What is graph in c?
What happens if a header file is included twice?
What is an auto variable in c?
What is pointer to pointer in c with example?
How can I remove the trailing spaces from a string?
What header files do I need in order to define the standard library functions I use?