You need a for loop most likely: http://www.cprogramming.com/tutorial/lesson3.html