Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


swap two number wthout using third variable

Answers were Sorted based on User's Feedback



swap two number wthout using third variable..

Answer / jvhariharan

void main()
{
int a=10,b=20;
a=a+b;
b=a-b;
a=a-b;
}

Is This Answer Correct ?    24 Yes 3 No

swap two number wthout using third variable..

Answer / ashutosh tiwari

void swap_num(int *a, int *b)
{
*a = *a+*b; *b = *a-*b; *a = *a-*b;
}
or
void swap_num(int *a,int *b)
{
*a = *a^*b; *b = *a^*b; *a = *a^*b;
}

Is This Answer Correct ?    8 Yes 0 No

swap two number wthout using third variable..

Answer / suyog

A very simple and cute answer...

Assign as follows

a=a+b-(b=a)

Is This Answer Correct ?    6 Yes 0 No

swap two number wthout using third variable..

Answer / abhay khare

void main()
{
int a,b,c
printf("two no are\n");
scanf("%d&n");
a=c;
b=a
c=b
getch;
}

Is This Answer Correct ?    1 Yes 10 No

Post New Answer

More Programming Languages AllOther Interview Questions

What is web.configuration? how is it work? & wht is use this?

0 Answers  


5. How do you round the addition or subtraction of two numbers in assembler?

0 Answers   Wipro,


1.Mutating table

0 Answers  


What function would you use to extract characters from a given string?

2 Answers  


Hi All, Can any one please send me the difference between informatica 7i and 8i versions, Thanks in advance. vinod

0 Answers  


how we define two jobs have same name??is it exist??

0 Answers   CTS,


What is the requirement in MIMD ?

1 Answers   Honeywell,


What is the effect of the OPTIONS statement ERRORS=1?

3 Answers   QSG, Quintiles, SAS,


can we convert .class file to dll file

1 Answers  


How do i find out the number of parameters passed into function?

0 Answers  


In loading programs into memory, what is the difference between load-time dynamic linking and run-time dynamic linking?

0 Answers  


what is jackson structured develepment?? and how is it different from OMT??

1 Answers  


Categories