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
How do I enable javascript?
How do I enable java in firefox?
What is lambda expression in mvc?
What is ehcache in java?
What is a java singleton?
What is microservices java?
What is stateless in java?
What is the use of jprofiler?
What is jpa implementation?
What is the use of flatmap?
Explain different way of using thread?
What is serializable in java?
How do I install jdk?
What is an api in java?
What is stateful in java?