write a program to swap Two numbers without using temp variable.
Answer Posted / ankit tiwari
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("enter the two number");
scanf("%d%d",&a,&b);
a=b-a;
b=b-a;
a=b+a;
printf("ais=%d",a);
printf("b is=%d",b);
getch();
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is getche() function?
What is the difference between pure virtual function and virtual function?
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
What is the meaning of c in c language?
What is data types?
What is pointer and structure in c?
Explain how do you sort filenames in a directory?
How can I split up a string into whitespace-separated fields?
Was 2000 a leap year?
What is include directive in c?
Can you subtract pointers from each other? Why would you?
What does != Mean in c?
What is echo in c programming?
In which header file is the null macro defined?
Why does everyone say not to use scanf? What should I use instead?