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 which language eclipse is developed?

661


What is the use of flatmap in java 8?

637


How long can a lambda function run?

702


What is maven in java?

651


Why do we create dto in java?

685


What about javascript? : java security

771


Can the main method be overloaded?

748


What are the Advantages of java se 8 new features?

725


What is difference between loosely coupled and tightly coupled in java?

614


Does netbeans need jdk?

667


Which is more secure: java or activex? : java security

690


What do you understand by a variable?

737


Define network programming?

721


Explain issues of old java date api?

769


What is default constructor in java?

638