Hi
im going to swap the first int in my arry whit the last.
int[] Tal = new int[10];
Console.WriteLine("10 numbers: ");
for (int i = 0; i < Tal.Length; i++)
{
Console.Write("number " + (i + 1) + ": ");
Tal[i] = int.Parse(Console.ReadLine());
}
Arra c = new Array();
c.FirstLast(Tal)
public void FirstLast(int[] arr)
{
foreach (int t in arr)
{
int temp = arr[0];
arr[0] = arr[9];
arr[9] = temp;
Console.WriteLine(t);
}
when i type in 1,2,3,4,5,6,7,8,9,10 and then it show 1,2,3,4,5,6,7,8,9,1
i want it to be 10,2,3,4,5,6,7,8,9,1. I know i replace the first whit the last but way dos it not replace the first one to whit the last.
sorry for the bad english. I hope someone will understand it