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
What are all different types of pointers in c?
In a switch statement, explain what will happen if a break statement is omitted?
What is meant by 'bit masking'?
What is the main difference between calloc () and malloc ()?
What are two dimensional arrays alternatively called as?
Write the syntax and purpose of a switch statement in C.
Is it better to use malloc() or calloc()?
Is return a keyword in c?
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)
I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.
Why n++ execute faster than n+1 ?
Write a program to check whether a number is prime or not using c?
What is the difference between struct and union in C?
Distinguish between actual and formal arguments.
What are type modifiers in c?