how to swap 4 number without using temporary number?

Answers were Sorted based on User's Feedback



how to swap 4 number without using temporary number?..

Answer / brinda balakrishnan

a=a+b+c+d;
b=a-(b+c+d);
c=a-(b+c+d);
d=a-(b+c+d);
a=a-(b+c+d);

Is This Answer Correct ?    25 Yes 0 No

how to swap 4 number without using temporary number?..

Answer / sandeep

a=a^b;
b=a^b;
a=a^b;

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More C Interview Questions

What is union in c?

0 Answers  


process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,

0 Answers   InterGraph,


If input is 123 then how to print 100 and 20 and 3 seperately?

4 Answers  


Difference between linking and loading?

0 Answers  


what is event driven software and what is procedural driven software?

0 Answers  


what does " calloc" do?

7 Answers   Cadence, Logos,


Consider the following C program. #include <stdio.h> int main() { int i; for (i=0;i<3;++i) { fork();fork(); } } How many processes are created when running this program (including the initial one)? Explain

2 Answers  


What is the output of below code? main() { static int a=5; printf("%3d",a--); if(a) main(); }

1 Answers  


Is anything faster than c?

0 Answers  


Compare interpreters and compilers.

0 Answers  


What is the difference between text files and binary files?

0 Answers  


Should I learn data structures in c or python?

0 Answers  


Categories