swap two integer variables without using a third temporary
variable?

Answer Posted / sumit salve

a=a+b-(b=a);
or
a=a*b/(b=a);
this will also swap two numbers!!!

Thank You...

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

in iso what are the common technological language?

1616


Does c have function or method?

575


Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.

2639


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

2256


What is the method to save data in stack data structure type?

592






What are the types of arrays in c?

612


What is meant by int main ()?

705


What is assert and when would I use it?

566


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

680


Write a program to find factorial of a number using recursive function.

632


what is the role you expect in software industry?

1640


design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.

1483


Explain about the functions strcat() and strcmp()?

589


What is the equivalent code of the following statement in WHILE LOOP format?

752


Why c is faster than c++?

619