Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Problem using array.

$
0
0
So good day to everyone! Thank you for entering my thread. So I create a program which will output: 1 2 3 4 5 6 7 8 9 - 26 but the problem it's only output is on below.
Here is the code.
int[] anNumber= new int[26];
int x,y,i,sum;
String a;
anNumber[0]=1;
for(i=0;i<anNumber.length;i++){
anNumber[i]++;
System.out.print("\n"+anNumber[i]);
}



-___- The output is:
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>