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
what is the basis for selection of arrays or pointers as data structure in a program
What is 1f in c?
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
What is the difference between memcpy and memmove?
Can we declare a function inside a function in c?
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10
Why should I use standard library functions instead of writing my own?
Can you please explain the difference between strcpy() and memcpy() function?
What does %c mean in c?
What is c definition?
What is an array? What the different types of arrays in c?
What are the parts of c program?
What type of function is main ()?
What is optimization in c?
What are pointers in C? Give an example where to illustrate their significance.