how to swap 4 number without using temporary number?

Answer Posted / brinda balakrishnan

a=a+b+c+d;
b=a-(b+c+d);
c=a-(b+c+d);
d=a-(b+c+d);
a=a-(b+c+d);

Is This Answer Correct ?    25 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Calculate the weighted average of a list of n numbers using the formula xavg = f1x1+f2x2+ ….+ fnxn where the f’s are fractional weighting factors, i.e., 0<=fi<1, and f1+f2+….+fn = 1

3663


What is const keyword in c?

753


Is javascript based on c?

598


Explain the use of function toupper() with and example code?

658


What is the auto keyword good for?

631






What is keyword in c?

608


What are all different types of pointers in c?

581


What is the purpose of main( ) in c language?

628


What is array of structure in c programming?

759


Explain the term printf() and scanf() used in c language?

600


Explain how do you use a pointer to a function?

642


Differentiate call by value and call by reference?

572


Explain pointer. What are function pointers in C?

630


What is difference between main and void main?

631


What is c programing language?

618