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...


wat are the two methods for swapping two numbers without
using temp variable??

Answers were Sorted based on User's Feedback



wat are the two methods for swapping two numbers without using temp variable??..

Answer / vijayakumar kanagasabai

main()
{
int a=4;b=6;
printf("Before swapping: a=%d, b=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("After swapping: a=%d, b=%d",a,b);
}

Is This Answer Correct ?    11 Yes 1 No

wat are the two methods for swapping two numbers without using temp variable??..

Answer / saida

int a=4,b=6;
printf("Before swapping: a=%d, b=%d",a,b);
a=a^b;
b=a^b;
a=a^b;
printf("After swapping: a=%d, b=%d",a,b);
}

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C Interview Questions

main() { int age; float ht; printf("Enter height and age"); scanf("%d%d",&height,&age); if((age<=20)&&(ht>=5)) {printf("She loves you");} else {printf("She loves you");} }

2 Answers  


Explain the advantages and disadvantages of macros.

0 Answers   TCS,


What is wrong in this statement? scanf(“%d”,whatnumber);

0 Answers  


Explain main function in c?

0 Answers  


How does struct work in c?

0 Answers  


write a program wch produces its own source code aas its output?

1 Answers   IonIdea,


what is the output of below pgm? void main() { int i=0; if(i) printf("pass"); else printf("fail"); }

4 Answers  


What does sizeof function do?

0 Answers  


What are high level languages like C and FORTRAN also known as?

0 Answers  


what is the output of the following program? main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); }

7 Answers  


Explain how do you use a pointer to a function?

0 Answers  


Can you add pointers together? Why would you?

0 Answers  


Categories