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 / mangala pandi p
provided a+b is between the int minimum and int maximum
so the answer is no.
| Is This Answer Correct ? | 6 Yes | 5 No |
Post New Answer View All Answers
What is data type long in c?
Are pointers integers in c?
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].
what is the function of pragma directive in c?
What does 2n 4c mean?
Is file a keyword in c?
What is hungarian notation? Is it worthwhile?
to find the closest pair
Can we change the value of static variable in c?
Is multithreading possible in c?
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?
What is typedf?
Difference between MAC vs. IP Addressing
What do you know about the use of bit field?