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

What is meant by code profiling?

504


Is java an api?

477


What is cdi bean in java?

538


What is flatmap in java8?

503


What are the differences between java’s old java date api and java 8’s date and time api?

548






How do I enable java in firefox?

493


What is serializable in java?

482


What is difference between map and flatmap in java 8?

482


What is the use of rs next () in java?

502


Which is faster c++ or java?

525


What is dto layer in java?

466


What is cdi in java?

490


how can we create the ui using netbeans,having the code?

1633


How do I open my java console?

505


What is the difference between map and flatmap in java?

486