How many ways are there to swap two numbers without using
temporary variable? Give the each logic.

Answer Posted / chandan doki

void main()
{
int a,b;
printf("eneter any two values for a and b");
scanf("%d%d",&a,&b);
b=a+b;
a=b-a;
b=b-a;
printf("a=%d\nb=%d",a,b);
getch();
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are identifiers c?

569


What does sizeof return c?

610


What is the difference between far and near in c?

604


What is an expression?

660


i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical

1847






why wipro wase

1833


a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list

636


What is pass by value in c?

598


What is sizeof array in c?

597


where are auto variables stored? What are the characteristics of an auto variable?

597


How do I send escape sequences to control a terminal or other device?

615


Why doesn't C support function overloading?

1624


What 'lex' does?

722


A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

650


Can you please compare array with pointer?

619