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

How to swap two variables, without using third variable ?

Answer Posted / ankush

using ref keyword we can swap 2 number's

emaple
class swap
{
public void add(ref int a,ref int b)
{
int z;
z=a;
a=b;
b=z;
}
}
class swapdemo
{
static void main()
{
int x=10,y=5;
ankush obj=new ankush();
Console.writeline{"befor value's"+a+","+b};
obj.swap(ref x, ref y);
Console.writeline("after values"+a+","+b);
}
}

Is This Answer Correct ?    13 Yes 72 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange

3319


#include int main(void) { int a=4, b=2; a=b<>2 ; printf("%d",a); return 0; }

1587


What is data _null_? ,Explain with code when u need to use it in data step programming ?

3304


can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail

2920


why nlogn is the lower limit of any sort algorithm?

2801


What is full form of PEPSI

2384


write a program for area of circumference of shapes

2521


Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?

4359


why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?

2735


Cluster head selection in Wireless Sensor Network using C programming language.

3700


What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?

4465


Design an implement of the inputs functions for event mode

3473


Write a program to model an exploding firecracker in the xy plane using a particle system

4110


write a simple calculator c program to perform addition, subtraction, mul and div.

3695


how to test pierrot divisor

2732