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 / shouvik mitra
This code gives the interchange values of the two variables.But this code can also give the same result for the two variables when same numbers are inputted in both the variables, i.e. say a=5,b=5.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
How many loops are there in c?
What are the disadvantages of a shell structure?
Is fortran still used in 2018?
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
How many bytes are occupied by near, far and huge pointers (dos)?
How old is c programming language?
What is multidimensional arrays
How do you convert strings to numbers in C?
What is string function c?
Give the rules for variable declaration?
What are the types of variables in c?
What are shell structures used for?
When is the “void” keyword used in a function?
What is the difference between constant pointer and constant variable?