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 / chandan

#!/usr/bin/perl
print "Enter Values for a & b\n";
my ($a,$b);
$a=<STDIN>;
$b=<STDIN>;
print "Value of A & B Befor Swap\n";
print "Value of a = $a\n";
print "Value of b = $b\n";
$b=($a+$b)-($a=$b);
print "Value of A & B After Swaping\n";
print "Value of a = $a\n";
print "Value of b = $b\n";

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the c language function prototype?

1095


What is array in C

1173


What is difference between scanf and gets?

1288


Place the #include statement must be written in the program?

1048


Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.

1119


How many bytes are occupied by near, far and huge pointers (dos)?

1166


In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?

1234


What are identifiers c?

1099


What is table lookup in c?

1106


Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.

2324


What is the use of putchar function?

1062


What is the use of c language in real life?

1031


What is typedef?

1438


What is the heap?

1225


What is static identifier?

1230