****_______:)
Here up now I'm going to perform and show the code of storing value using array methods and with its corresponding value of its index.
And in getting the values of the index of the array,then to display its original value and the reverse value of the index using a methods.
__________________________________________________________________
//declaring the array variable and its given index value
int[]number=new int [3];
int[0]=2;
int[1]=3;
int[2]=5;
//displaying the values of the index
Console.WriteLine("This are the Original Value of the Array Index: ");
for(int i=0;i<number.Lenght;i++)
{
Console.Write(number[i]);
}
//declaring index to hold the reverseValue Method
int index;
index=reverseValue(number);
Console.WriteLine("-------------------------------------------------------");
//displaying the reverse value of the array index
Console.WriteLine("This is the reverse Value of the Original Value of the array index");
for(int idx=0;idx<index.Lenght;idx++)
{
Console.WriteLine(index[idx]);
}
//public static methods that performs the reverse event of the original values of the array index
public static int[]reverseValue(int[]myarray)
{
int[]Origvalue=int new[3];
int istart=0;
int ctr=number.Lenght-1;
do
{
Origvalue[istart]=myarray[ctr];
istart++;
ctr--;
}while(istart<number.Lenght-1);
return Origvalue;
}
__________________________________________________________________And there up Now...
:) have a nice day always and enjoy your game.
===Badi====
Edited by Jordan, 08 July 2009 - 06:29 AM.
Added Code Tags


Sign In
Create Account

Back to top









