C# Remove unused index in an array with a declared size. : I have a programming homework where we are required to use methods to ask for input, store them in an array, and then use a sentinel value or until the array is filled, displays all the content of the array. So far, the program works but my problem is whenever I don't fill up the array (exiting with a sentinel value) and then displaying it, it shows a bunch of zeroes with the unused index. 

For example:
int [] sample = new int[5]; // max size of array
// user input 3 numbers with loop (for ex. 1, 2, 3 and then exits with 555)

how do I make it display as

1
2
3

instead of

1
2
3
0
0

