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
Difference between delegates and Events?
when we use mantis? how learn mantis?
SAS question: I have 50 fils a1,a2,...,a50. the primary key is upc. then if i want to merge all 50 files, the code is as follows, data test; merge a1 ... a50; by upc; run; we know that writing all 50 files name is time consuming, is there any standard format of this code?
iam confused among testing ,.net and java. can anybody help me.
Write a program to reverse a number?
In project we have Documentation phase also,in that what is micro and macro designing?
Busy waiting is a method whereas a taskwaits for a given event by continiously checking for an event to occur. What is the main problem with this approach
how to convert the data from HTML file to SAS dataset?
What for decision coverage and modified condition decision coverage are used? Wat is the difference between them?
Suppose server object is not loaded into the memory, and the client request for it , what will happen?
Write a shell program. Enter number of days from keyboard. Find out the number of years, month and days it contains
You are given a dictionary of all valid words. You have the following 3 operations permitted on a word: delete a character, insert a character, replace a character. Now given two words - word1 and word2 - find the minimum number of steps required to convert word1 to word2. (one operation counts as 1 step.)
Hi all... I had completed MSC(Computer) and had join the construction company based on sap.they want me to work on abap.but software company is totally different from construction company and they want me 2 grasp it as fast i can.i am finding it difficult.what should i do??????
My Qualification is MCA.My interview is on 5th may.They may ask q as------AS u r MCA...Why u r not tring anywhere else? What can be the ans?
how do u handle table control inbdc explain the process in steps iwant the answer in urgent please forward this even i know how to explain there