Answer Posted / yadhunandan.t
wap to swap two numbers without using third variable.
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("enter the value of a & b");
scanf("%d %d",&a,&b);
printf("\n\n\n before swaping");
printf("\n\ta:%d",a);
printf("\n\tb:%d",b);
a=a+b;
b=a-b;
a=a-b;
printf("\n\n\n after swaping");
printf("\n\ta:%d",a);
printf("\n\tb:%d",b);
getch();
}
Is This Answer Correct ? | 5 Yes | 3 No |
Post New Answer View All Answers
In which language eclipse is developed?
What is the use of flatmap in java 8?
How long can a lambda function run?
What is maven in java?
Why do we create dto in java?
What about javascript? : java security
Can the main method be overloaded?
What are the Advantages of java se 8 new features?
What is difference between loosely coupled and tightly coupled in java?
Does netbeans need jdk?
Which is more secure: java or activex? : java security
What do you understand by a variable?
Define network programming?
Explain issues of old java date api?
What is default constructor in java?