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 a uint8?

479


What is the locale class?

518


How can c# app request minimum permissions? : java security

463


What are tags in java?

484


What is dependency injection in java?

466






For each of the following program segments,give a big zero analysis for the running time 1.For (i=0;i

1498


What is meant by code profiling?

492


What are the disadvantages of java sockets?

578


I have deployed a .war file in my application server comprising of struts and hibernate.If i want to change the "dialect" property of hibernate cfg file how can i change(I have only .war file)... Thanks in advance

1431


What is static class in java?

504


What is the difference between Logical Parallelism and Physical Parallelism?

2949


What is meant by annotations in java?

480


What is javacpl?

489


What is a java singleton?

468


What happens when you omit a brace or misspell one of the words, like public or

464