Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


wat are the two methods for swapping two numbers without
using temp variable??

Answers were Sorted based on User's Feedback



wat are the two methods for swapping two numbers without using temp variable??..

Answer / vijayakumar kanagasabai

main()
{
int a=4;b=6;
printf("Before swapping: a=%d, b=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("After swapping: a=%d, b=%d",a,b);
}

Is This Answer Correct ?    11 Yes 1 No

wat are the two methods for swapping two numbers without using temp variable??..

Answer / saida

int a=4,b=6;
printf("Before swapping: a=%d, b=%d",a,b);
a=a^b;
b=a^b;
a=a^b;
printf("After swapping: a=%d, b=%d",a,b);
}

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C Interview Questions

What are the keywords in c?

0 Answers  


Tell about strtok & strstr functions

2 Answers   HCL, iFlex, Motorola,


Write a program to find the number of times that a given word(i.e. a short string) occurs in a sentence (i.e. a long string!). Read data from standard input. The first line is a single word, which is followed by general text on the second line. Read both up to a newline character, and insert a terminating null before processing. Typical output should be: The word is "the". The sentence is "the cat sat on the mat". The word occurs 2 times.

0 Answers  


Explain what is the concatenation operator?

0 Answers  


What is formal argument?

0 Answers  


Explain what will be the outcome of the following conditional statement if the value of variable s is 10?

0 Answers  


What is a #include preprocessor?

0 Answers  


Who is invented by c?

24 Answers   Infosys, Mphasis,


7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.

0 Answers  


What is far pointer in c?

0 Answers  


which types of data structure will i use to convert infix to post fix???

5 Answers   IIT,


Explain how do you list a file’s date and time?

0 Answers  


Categories