how to swap 2 numbers in a single statement?

Answer Posted / pedda

t=a;
a=b;
b=t;
t means temporary value

Is This Answer Correct ?    3 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is this pointer in c plus plus?

586


Differentiate between new and malloc(), delete and free() ?

656


How are structure passing and returning implemented?

583


What is the difference between test design and test case design?

1559


Why is structure padding done in c?

631






What are different types of operators?

585


if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0

1433


Explain what is the general form of a c program?

616


Does sprintf put null character?

583


Why cant I open a file by its explicit path?

585


What are the string functions? List some string functions available in c.

594


Explain what are the different data types in c?

743


Write a program to generate random numbers in c?

649


I came across some code that puts a (void) cast before each call to printf. Why?

662


Why doesn't C support function overloading?

1594