HOW TO SWAP TWO NOS IN ONE STEP?

Answer Posted / sasikumar

main()
{
int a,b,c;
printf("enter two no's :");
scanf("%d%d",&a,&b);
c=a^=b^=a^=b;
printf("%d",c);
}

Is This Answer Correct ?    6 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between printf and scanf in c?

869


Is file a keyword in c?

605


which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;

2722


What is the general form of #line preprocessor?

678


What is quick sort in c?

699






When is a null pointer used?

737


Why do we use stdio h and conio h?

749


Whats s or c mean?

690


What is the difference between int main and void main in c?

697


What's the right way to use errno?

734


Why we use int main and void main?

648


Can we replace the struct function in tree syntax with a union?

891


Explain how can a program be made to print the line number where an error occurs?

796


Write a code to determine the total number of stops an elevator would take to serve N number of people.

840


What are the different types of data structures in c?

717