write a program to swap Two numbers without using temp variable.
Answer Posted / swechha
a=a-b
b=a+b
a=b-a
if a=5 and b=10 then
a=5-10=(-5)
b=(-5)+10=5
a=5-(-5)=5+5=10
now a=10 & b=5
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How reliable are floating-point comparisons?
What is the mean of function?
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
Can we access array using pointer in c language?
What is the difference between array and pointer in c?
Is it possible to execute code even after the program exits the main() function?
What is spaghetti programming?
What is LINKED LIST? How can you access the last element in a linked list?
What are types of structure?
What is pointer & why it is used?
What is the method to save data in stack data structure type?
Why do we need a structure?
What are the advantages of using linked list for tree construction?
What is property type c?
main() { printf("hello"); fork(); }