My version was older than the Amazon version as I learned in 1987.
You declared the array wrong, correct way:
Also you cannot declare two as rename the second:
to something else.
Might I suggest some good C Books? I think you need to learn C before coding in it.
Reference Style - All Levels
This is a common mistake amongst newer C/C++ developers. The scanf function detects you hitting the ENTER/RETURN key to signal the end of input, but it also catches the \n character as well at the end of the input string, so you essentially get two RETURNS being detected.
Please read up on an example of using fgets and sscanf here:
It will resolve this issue very quickly for you. In the meantime, I strongly urge you to check out this book:
It is the most commonly used C programming book in high school and colleges in North America, and has TONS of examples for you to work through, including this specific program you demonstrated above. The print version has more examples than the e-book, so I would just cough up the $30.00 for the printed version.