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...


wat are the two methods for swapping two numbers without
using temp variable??

Answers were Sorted based on User's Feedback



wat are the two methods for swapping two numbers without using temp variable??..

Answer / shrikantauti

i dont know the methods but can give the code to swap values without temporary variable.
a b
a=a+b
b=a-b
a=a-b

Is This Answer Correct ?    6 Yes 0 No

wat are the two methods for swapping two numbers without using temp variable??..

Answer / abhishek karnani

int a=10,b=5;

a=a+b-(b=a);

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More C Interview Questions

Why we use void main in c?

0 Answers  


Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

0 Answers   TATA, TCS,


what is the most appropriate way to write a multi-statement macro?

1 Answers  


What is the significance of scope resolution operator?

0 Answers   Agilent, ZS Associates,


What does volatile do?

0 Answers  


What are pragmas and what are they good for?

0 Answers  


what are the advantage of pointer variables? write a program to count the number of vowels and consonants in a given string

3 Answers  


Write a program to swap two numbers without using third variable in c?

0 Answers  


Can an array be an Ivalue?

0 Answers   EXL,


#include<stdio.h> void main() { int =1; printf("%d%d%d",a++,++a,++a); }

3 Answers   VB,


how does a general function , that accepts an array as a parameter, "knows" the size of the array ? How should it define it parameters list ?

0 Answers  


How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?

2 Answers  


Categories