How do we swap or interchange any 2 numbers without using
Temporary variable...Anybody can pls answer it.. Thanks in
Advance
Answer Posted / srikanth
int x,y;
x =x-y;
y =y+x;
x =y-x;
or
int x,y;
x=x^y;
y=x^y;
x=x^y;
or
int x,y;
x*=xy;
y=x/y;
x=x/y;
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
Why header files are used?
the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....
If errno contains a nonzero number, is there an error?
What is type qualifiers?
How do I use void main?
Why do we use null pointer?
general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only
What are terms in math?
Function calling procedures? and their differences? Why should one go for Call by Reference?
How can I change their mode to binary?
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
What are register variables? What are the advantage of using register variables?
What is a far pointer in c?
Is there a built-in function in C that can be used for sorting data?