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

How to swap two values using a single variable ?

condition: Not to use Array and Pointer ?

Answer Posted / aditya

main(){
int a=10,b=20;
printf("%d%d",a,b);
a^=b,b^=a,a^=b;
printf("%d%d",a,b);

}

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?

3525


Is c procedural or object oriented?

1029


What is sizeof int in c?

1064


What does double pointer mean in c?

1191


which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above

2067


The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none

1246


Write a program to identify if a given binary tree is balanced or not.

1172


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

1288


Is it valid to address one element beyond the end of an array?

1176


Can we replace the struct function in tree syntax with a union?

1315


explain what is fifo?

1087


What is a far pointer in c?

1049


What is s in c?

1056


What does sizeof int return?

1086


How can I get the current date or time of day in a c program?

1229