I have a code here and I would like that it will display the first 10 and if I click on that, it will display again the second batch. I tried this first with my first for-code and it work now I’m working with arrays it seems it didn’t accept it
The one I commented dont work? is this wrong? Thanks
long [] potenzen = new long[32]; potenzen[0] = 1; for (int i = 1; i < potenzen.Length; ++i) { potenzen[i] = potenzen[i-1] * 2; //if (potenzen % 10 == 0) // Console.ReadLine(); } foreach (long elem in potenzen) { Console.WriteLine(' ' + elem); }
is more in line with what you want. An improvement would be to separate your data-manipulation logic from your data display logic.
Of course, you could do this without an array