write a program to swap Two numbers without using temp variable.
Answer Posted / anantha
b=a+b
a=b-a
b=b-a
if a=3 and b=5
then now b=a+b=8
and a=8-a=8-3=5,now a=5
b=8-a=8-5=3,now b=3
so, a=5 and b=3
| Is This Answer Correct ? | 198 Yes | 59 No |
Post New Answer View All Answers
What is header file in c?
Where are the auto variables stored?
Explain how can you restore a redirected standard stream?
What is the difference between far and near in c?
How arrays can be passed to a user defined function
What is a structure and why it is used?
When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm
Disadvantages of C language.
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result
Differentiate fundamental data types and derived data types in C.
What is the use of bitwise operator?
What are the types of arrays in c?
How can I handle floating-point exceptions gracefully?