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 web container in java?
What's the difference between local, global and universal groups? : java security
What is cmp in java?
How can I protect myself? : java security
How do I run a java project?
Which instutute is offering course for rhino jain slee
What is a pojo class in java?
What is @override annotation in java?
Which class is the superclass of every class?
What is the difference between swing and awt components?
What happens when the parent process of a child process exits before the child ?
Can java program run without jdk?
what is reflection api? How are they implemented?
What does jpa mean?
What is meant by pass by reference and pass by value in java?