Um...what? So you're trying to traverse an array with a do..while loop in forward order?
int i = 0;
do
Console.Write(array[i] + " ");
while (++i < array.Count);
Or if you can't have a counter starting from 0 and must have a descending counter starting from array.Count, the difference of the counter and array.Count will give you what you want:
int i = array.Count;
do
Console.Write(array[array.Count - i] + " ");
while (--i != 0);
deceptikon
Challenge Accepted
3,427 posts since Jan 2012
Reputation Points: 822
Solved Threads: 473
Skill Endorsements: 56
It is conventional and more readable to use a for loop or a foreach loop, if the language has one.
for(int i = 0; i < array.Count; ++i){
Console.Write( array[i] );
}
firstPerson
Industrious Poster
4,044 posts since Dec 2008
Reputation Points: 851
Solved Threads: 625
Skill Endorsements: 14