Write a program to interchange two variables without using
the third variable?

Answer Posted / vinay tiwari

void main()
{
int a,b;
printf("enter two no ");
scanf("%d%d",&a,&b);
printf("a=%d and b=%d",a,b);
a=a^b;
b=a^b;
a=a^b;
printf("a=%d and b=%d",a,b);
getch();
}

Is This Answer Correct ?    22 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon

1726


What are the 4 types of organizational structures?

613


How can you find out how much memory is available?

606


Explain what is a stream?

599


What are pointers? Why are they used?

623






How many header files are in c?

540


What is the purpose of main() function?

647


What is default value of global variable in c?

552


What does 4d mean in c?

930


What does the c preprocessor do?

609


What is operator precedence?

635


Explain indirection?

631


what is the role you expect in software industry?

1644


How can I do graphics in c?

586


What is a sequential access file?

641