how to swap two integers 1 and 32767 without using third
variable
Answer Posted / mani654mani
Int var1=1, var2=32767;
var1 = var1 + var2;
var1 = 1 + 32767 =32768;
var2 = var1 - var2;
var2 = 32768 - 32767 = 1;
var1 = var1 - var2;
var1 = 32768 - 1 = 32767;
So Now var1 = 32767 and var2 = 1
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
What is const and volatile in c?
What is difference between %d and %i in c?
Why do we need a structure?
Write a function that will take in a phone number and output all possible alphabetical combinations
Is there sort function in c?
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
Difference between constant pointer and pointer to a constant.
Explain how can I right-justify a string?
What is string constants?
write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);
What is the g value paradox?
What is meant by preprocessor in c?
what is the syallabus of computer science students in group- 1?
What type is sizeof?