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

write a program to swap Two numbers without using temp variable.

Answer Posted / prudhvi

int a, b, c;
a = int.Parse(Console.ReadLine());
b = int.Parse(Console.ReadLine());
c = b;
b = a;
a = c;
Console.WriteLine("a={0},b={1}",a,b);
Console.ReadLine();




}

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which of the following operators is incorrect and why? ( >=, <=, <>, ==)

1162


application attempts to perform an operation?

1969


Function calling procedures? and their differences? Why should one go for Call by Reference?

1081


Why is c so important?

1060


What is function what are the types of function?

991


Why static variable is used in c?

1033


Explain what is gets() function?

1069


Is c a great language, or what?

1104


Explain modulus operator. What are the restrictions of a modulus operator?

1010


Why we use break in c?

1001


Can the size of an array be declared at runtime?

1078


What is meant by int main ()?

1200


What is the method to save data in stack data structure type?

1080


Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)

1282


Why do we need volatile in c?

1164