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 struct node in c?
Why c is procedure oriented?
What is the difference between int main and void main?
Explain how can type-insensitive macros be created?
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
What is the difference between struct and typedef struct in c?
What is c programming structure?
What is the basic structure of c?
How does pointer work in c?
write a program to print data of 5 five students with structures?
Can stdout be forced to print somewhere other than the screen?
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
Differentiate between Macro and ordinary definition.
What are the advantages of using new operator as compared to the function malloc ()?
What are enums in c?