write a program to swap Two numbers without using temp variable.

Answer Posted / prasanna

Swapping two variables in a single line with no temporary
variable..

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

so.. simple..

Prasanna. (prasanna7287@yahoo.co.in)

Is This Answer Correct ?    351 Yes 140 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is c is a middle level language?

778


Can main () be called recursively?

846


Describe wild pointers in c?

825


Explain what are the different file extensions involved when programming in c?

819


Explain what are bus errors, memory faults, and core dumps?

998






Explain what is the advantage of a random access file?

871


Explain how does flowchart help in writing a program?

836


Difference between malloc() and calloc() function?

853


What are data types in c language?

773


What is array in C

894


What is 'bus error'?

835


Why we write conio h in c?

745


How to declare a variable?

745


How many identifiers are there in c?

749


Can two or more operators such as and be combined in a single line of program code?

1090