write a program to swap Two numbers without using temp variable.
Answer Posted / tchoephel
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("enter two nos A and B\n");
scanf("%d%d",a,b);
printf("before swaping A=%d\n B=%d\n",a,b);
a=a+b:
b=a-b;
a=a-b;
prinf("after swaping A=%d\n B=%d\n",a,b);
getch();
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What does 4d mean in c?
What are the types of bitwise operator?
How can a program be made to print the name of a source file where an error occurs?
What are the features of c languages?
What is the best organizational structure?
What is the difference between new and malloc functions?
What are the benefits of organizational structure?
Simplify the program segment if X = B then C ← true else C ← false
How can I delete a file?
What are different types of operators?
What does printf does?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
difference between object file and executable file
When should the register modifier be used? Does it really help?
what is the c source code for the below output? 10 10 10 10 10 10 10 10 10 10 9 9 7 6 6 6 6 6 6 9 7 5 9 7 3 2 2 5 9 7 3 1 5 9 7 3 5 9 7 4 4 4 4 5 9 7 8 8 8 8 8 8 8 8 9