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
What is the c language function prototype?
What is array in C
What is difference between scanf and gets?
Place the #include statement must be written in the program?
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.
How many bytes are occupied by near, far and huge pointers (dos)?
In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?
What are identifiers c?
What is table lookup in c?
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.
What is the use of putchar function?
What is the use of c language in real life?
What is typedef?
What is the heap?
What is static identifier?