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
Explain the use of bit fieild.
What is malloc and calloc?
How is pointer initialized in c?
Where local variables are stored in c?
Explain what are the advantages and disadvantages of a heap?
Can you write the algorithm for Queue?
WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER
how do you execute a c program in unix.
What is pragma c?
What is the collection of communication lines and routers called?
Explain what are the different data types in c?
Why use int main instead of void main?
Can we access array using pointer in c language?
Define VARIABLE?
What is getch c?