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

In an htm form i have a button which makes us to open another page in 15sec.how will you do that?

1364


What is savepoint in java?

464


What is aop java?

466


Is lambda expression an object?

491


What do I need to install netbeans?

494






How should I format my code? How should I comment my code?

489


What is jdk for netbeans ide?

509


How do I install eclipse?

481


When a thread is created and started, what is its initial state?

549


How do I create an executable jar file?

460


Write a class which checks whether a given number is prime or not. Write another class to implement the behavior of previous class and print the series of twin prime number upto a given range.

1360


Are jvm’s platform independent?

493


What is scrollable resultset in java?

481


What is crud operations in java?

470


What is repository pattern in java?

483