>>With the two additions, it skips to the end after I enter the number of numbers
Because scanf() leaves the Enter key '\n' in the keyboard buffer, and fgets() stops reading at the first '\n' it encounters. Call getchr() after scanf() to remove '\n' from the keyboard buffer.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Instead of using fgets() , use a FOR loop to readnum numbers using scanf("%d"...) .
WaltP
Posting Sage w/ dash of thyme
10,505 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944