Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


swap two number wthout using third variable

Answers were Sorted based on User's Feedback



swap two number wthout using third variable..

Answer / jvhariharan

void main()
{
int a=10,b=20;
a=a+b;
b=a-b;
a=a-b;
}

Is This Answer Correct ?    24 Yes 3 No

swap two number wthout using third variable..

Answer / ashutosh tiwari

void swap_num(int *a, int *b)
{
*a = *a+*b; *b = *a-*b; *a = *a-*b;
}
or
void swap_num(int *a,int *b)
{
*a = *a^*b; *b = *a^*b; *a = *a^*b;
}

Is This Answer Correct ?    8 Yes 0 No

swap two number wthout using third variable..

Answer / suyog

A very simple and cute answer...

Assign as follows

a=a+b-(b=a)

Is This Answer Correct ?    6 Yes 0 No

swap two number wthout using third variable..

Answer / abhay khare

void main()
{
int a,b,c
printf("two no are\n");
scanf("%d&n");
a=c;
b=a
c=b
getch;
}

Is This Answer Correct ?    1 Yes 10 No

Post New Answer

More Programming Languages AllOther Interview Questions

what are the difference between C,C++and Java

1 Answers   Wipro,


Explain the types of operations? Draw the figure for shift and rotate operations?

0 Answers  


why we use new keyword for object

4 Answers   TCS,


What is nocopy in plsql?

1 Answers   IBA Health,


HOW TO BREAK THE FIREWALL?

0 Answers   ME,


hi This is radhika.Can anyone help me to know the question papers of NATIONAL INFORMATICS CENTRE for the post of scientific officer/engineer? if anyone know plz tell me question paper pattern

0 Answers  


Please anyone tell me coding to print prime numbers from 1 to 5000 in c#....

2 Answers  


When you deliver your C++ headers and C++ library of a class (what all can you change in the class so that application using your class does not need to recompile the code)

0 Answers   Yahoo,


what is throws keyword

1 Answers   IBM,


Write a program which inputs 2 integers representing the sides of a triangle, a and b. Next, write a function which accepts the 2 sides as parameters and returns the hypotenuse of the triangle, c. Use c 2 = a 2 + b 2 To raise a number to an exponent, us e the built - in JavaScript function Math.pow() Let’s say you have a variable x and you want to raise it to the 5 th power, use Math.pow in the following manner... Math.pow( x, 5 ); This will raise x to the 5 th power. To find the square root of a number, use t he built - in JavaScript function Math.sqrt () So to find the square root of x, use Math.pow () in the following manner... Math.sqrt( x ) You must create 2 functions to receive credit for this assignment. Your ‘ main ’ function which is called from the button. And your hypotenuse function. Again, the main function calls upon the hypotenuse f unction when it needs that value. Get the user ’ s input, call the function, output your result. Create your own CSS layout

0 Answers  


through which algorithm does the garbage collector works? how the garbage collector will understand that the object will going to be deleted?

0 Answers   Motorola,


Info for guidewire documents and interview questions

1 Answers  


Categories