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
Why dont c comments nest?
How do you search data in a data file using random access method?
What are the header files used in c language?
how to count no of words,characters,lines in a paragraph.
How many types of sorting are there in c?
How do you print only part of a string?
What is the general form of function in c?
What is boolean in c?
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??
What is the use of parallelize in spark?
Write a program that accept anumber in words
Write a program to implement queue.
Explain what is wrong with this statement? Myname = ?robin?;
What is the size of structure pointer in c?
What is function prototype in c language?