How to swap values between two variables without using a
third variable?
Answer Posted / vinodkumar
main()
{
int a=10,b=8;
void swap(a,b)
/*it does not return any value because return statement can
return only one value at a time*/
{
a=a+b;/*a=10+8,a=18*/
b=a-b;/*b=18-8,b=10*/
a=a-b;/*a=18-10,a=8*/
printf("after swaping a= %dand b=%d",&a,&b);
}
getch()
}
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
what is technical system, business system, logical system in sap pi7.0
Describe the difference between Interface-oriented, Object-oriented and Aspect-oriented programming
how pseudo column works?
What is the Difference between in memory database and physical database
When we have two versions of the dot net installed how does the compiler know which version of DLL it has to select to an application.
What is BASIS
Given an array all of whose elements are positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be adjacent in the array. So 3 2 7 10 should return 13 (sum of 3 and 10) or 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)
sample and simple coding where we get?
which worker is involved in all the phases of SDLC?
will it allow to add same value in HashMap class.
what are importance in problem tracking
what are resources in case of Threads
hi i am jyoti i have done sap training in sd and master degree in economics have 2 year exp as enduser in (gdms)and 1 year as sd consultant.as contract basis now what i can do for getting job in it industry
What is test execution and when will we start execution please send me one example for this question
Write a function which accepts a sentence as input parameter.Each word in that sentence is to be reversed. Space should be there between each words.Return the sentence with reversed words to main function and produce the required output. for eg:- i/p: jack jill jung kill o/p: kcaj llij gnuj llik