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 a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
How do we make a global variable accessible across files? Explain the extern keyword?
program for reversing a selected line word by word when multiple lines are given without using strrev
the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset
What is exit() function?
Write a program to reverse a given number in c?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
How will you delete a node in DLL?
Write a code to remove duplicates in a string.
What is structure in c language?
#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }
Which of these functions is safer to use : fgets(), gets()? Why?
What's the total generic pointer type?
plz let me know how to become a telecom protocol tester. thank you.
How can you draw circles in C?