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 are the storage classes in C?

0 Answers  


write a program to swap two numbers without using temporary variable?

3 Answers  


#include<stdio.h> main() { char *p1; char *p2; p1=(char *) malloc(25); p2=(char *) malloc(25); strcpy(p1,"Ramco"); strcpy(p2,"Systems"); strcat(p1,p2); printf("%s",p1); } Tell me the output?

6 Answers   Ramco,


1. Write a c pgm to print 1 to 100 without using loops. 2. Write a c pgm for leap year 3. Write a c pgm fibbonacci series,factorial 4. Write a c pgm count no of lines , blanks, tabs in a para(File concept) 5. Write a c pgm to print the letter as per given condition i.e.. if u give 4 out put should b 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 6.how do get the o/p in number from 1 to 100 in the screen without using control statement? 7. who do u print the word "hello world" without using "printf" statement? 8. write sql program to get the detail of student in a class? Definitions: structure union arrays linkedlist macros directives difference b/w pre processorsDiffrence: 1.Constructors and destructors 2.Structure and Union 3.Array and Lists 4.pre processor... 5. Privillages in C++ 6.structure and union 7.break and continue 8.while and dowhile Pgm..

3 Answers  


What is pragma in c?

0 Answers  






What is a null pointer in c?

0 Answers  


What are different types of variables in c?

0 Answers  


Why do some versions of toupper act strangely if given an upper-case letter?

0 Answers  


what do u mean by Direct access files? then can u explain about Direct Access Files?

0 Answers   LG Soft,


Should I learn data structures in c or python?

0 Answers  


program to find the roots of a quardratic equation

1 Answers  


Is stack a keyword in c?

0 Answers  


Categories