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
What is a bean class?
What is the difference between a jvm and a jdk?
What is the difference between deep copy and shallow copy in java
Is lambda cheaper than ec2?
How do I install jdk?
Why we use beans in java?
Can we extract main method from another class?
How can I protect myself? : java security
What is meant by rest api in java?
What are jpa repositories?
Does netbeans need jdk?
Why are command line arguments passed as a string?
If you’re overriding the method equals() of an object, which other method you might also consider?
What are the risks in java security? : java security
What is aop java?