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 / moorthy
here a and b are local variable in function swap() where a
and b are swapped inside swap().so that swaping does not
affect variable in main().
| Is This Answer Correct ? | 12 Yes | 1 No |
Post New Answer View All Answers
Why is c called c?
What are the types of bitwise operator?
Is a house a shell structure?
What is data types?
Do pointers take up memory?
ATM machine and railway reservation class/object diagram
Explain the properties of union. What is the size of a union variable
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
How can a number be converted to a string?
Explain what are compound statements?
Can we initialize extern variable in c?
Can we access the array using a pointer in c language?
Which type of language is c?
What is putchar() function?
how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?