Write a program to exchange two variaables without temp

Answer Posted / sujith

another quick way is,

void main()
{
int a = 10, b = 5;
a ^= b ^= a ^= b;
}

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

string reverse using recursion

1805


Lists the benefits of c programming language?

590


What is scanf_s in c?

629


Calculate 1*2*3*____*n using recursive function??

1511


What are the key features in c programming language?

607






Write a program to print fibonacci series without using recursion?

599


What is a scope resolution operator in c?

745


write a program to copy the string using switch case?

2395


Are global variables static in c?

671


Write a program for finding factorial of a number.

629


Explain enumerated types in c language?

600


What was noalias and what ever happened to it?

590


how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions

2717


Why does everyone say not to use scanf? What should I use instead?

678


Where define directive used?

599