write a program to swap Two numbers without using temp variable.
Answer Posted / sree
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("Enter two numbers");
scanf("%d %d",&a &b);
a=a+b;
b=a-b;
a=a-b;
printf("The swapped values are:");
printf("a:%d",a);
printf("b:%d",b);
getch();
}
| Is This Answer Correct ? | 73 Yes | 24 No |
Post New Answer View All Answers
What are the different properties of variable number of arguments?
What is struct node in c?
If fflush wont work, what can I use to flush input?
What is the difference between union and anonymous union?
How to get string length of given string in c?
Explain what is the concatenation operator?
How can I access an I o board directly?
What is the purpose of realloc()?
What is 'bus error'?
Is struct oop?
What is const keyword in c?
p*=(++q)++*--p when p=q=1 while(q<=6)
What is wrong with this statement? Myname = 'robin';
What is the use of sizeof?
What is a stream?