hi all
first to begin let me wish everyone a happy new year to all
i am doing a program where i have to display reversed numbers. the program ask the enter 10 number, now the program seem to working fine except when it reach to the number 10 it gives an array out of bound index. i know that it is asking for a number that is more than what it is in the array but am seeing where it is getting the array out of bound but the problems is who do i fix it. here the is the codes that i have
in line 5 is where i am getting the array out of bound index
any help would be appreciated. thanks in advance
System.out.println("please enter 10 numbers");
for(i=1; i<=10; i++)
{
values [i]= userinput.nextInt(); (this line of codes here is where i am gettng the array out of boundindex
}
int[]reversednum;
reversednum = new int[10];
for(i = (values.length - 1); i>=0; i--)
{
reversednum [reversednum.length - 1 - i] = values[i];
System.out.println("reversednum[i");

