write a code in jsp to swap two numbers?

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


Please Help Members By Posting Answers For Below Questions

How do I enable javascript?

755


How do I enable java in firefox?

771


What is lambda expression in mvc?

728


What is ehcache in java?

722


What is a java singleton?

668


What is microservices java?

663


What is stateless in java?

755


What is the use of jprofiler?

679


What is jpa implementation?

682


What is the use of flatmap?

776


Explain different way of using thread?

796


What is serializable in java?

663


How do I install jdk?

673


What is an api in java?

728


What is stateful in java?

714