write a program to swap Two numbers without using temp variable.
Answer Posted / jaspreet singh
hey prasanna the program you hv writen is correct but this
method fails when we give the input as a=32767 and b=1
the correct method is
a^=b^=a^=b
or
a=a^b;
b=a^b;
a=a^b;
it will always return the correct answer even if the input
is a=32767 and b=1...............
| Is This Answer Correct ? | 17 Yes | 17 No |
Post New Answer View All Answers
Can you mix old-style and new-style function syntax?
What is the best organizational structure?
What is array of pointers to string?
Write a program to use switch statement.
why return type of main is not necessary in linux
What is the difference between text and binary i/o?
What is bubble sort technique in c?
Why is c known as a mother language?
write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.
What does dm mean sexually?
Explain pointer. What are function pointers in C?
What is difference between function overloading and operator overloading?
What is a function in c?
What are the types of data files?
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?