write a program to swap two numbers without using temporary
variable?
Answer Posted / it diploma student
let a and b be the variables
a=a+b
b=a-b
a=a-b
if we take a=5 and b = 7 then
a = 5+7 = 12
b = 12-7 = 5
a = 12-5 = 7
hence swaped...
| Is This Answer Correct ? | 26 Yes | 3 No |
Post New Answer View All Answers
What is the difference between variable declaration and variable definition in c?
Does c have an equivalent to pascals with statement?
Write a program to print “hello world” without using semicolon?
What is static volatile in c?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
Why we use conio h in c?
How will you delete a node in DLL?
How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same
What is the hardest programming language?
Are there constructors in c?
How do we make a global variable accessible across files? Explain the extern keyword?
What is an array? What the different types of arrays in c?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
What is dynamic variable in c?
What is the difference between formatted&unformatted i/o functions?