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 difference between c and python?
What is the use of bit field?
Explain the binary height balanced tree?
Can you pass an entire structure to functions?
I heard that you have to include stdio.h before calling printf. Why?
how to build a exercise findig min number of e heap with list imlemented?
Does * p ++ increment p or what it points to?
I need testPalindrome and removeSpace
#include
write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.
.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }
What are the primitive data types in c?
What is the hardest programming language?
What is an array in c?
What is bin sh c?
What functions are in conio h?