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
Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange
#include
What is data _null_? ,Explain with code when u need to use it in data step programming ?
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
why nlogn is the lower limit of any sort algorithm?
What is full form of PEPSI
write a program for area of circumference of shapes
Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?
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 ?
Cluster head selection in Wireless Sensor Network using C programming language.
What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?
Design an implement of the inputs functions for event mode
Write a program to model an exploding firecracker in the xy plane using a particle system
write a simple calculator c program to perform addition, subtraction, mul and div.
how to test pierrot divisor