I am attempting to write a program (for school) that will accept data about the length of metal rods and sort them into three categories (too long, too short, and normal), tally up the overall lengths of all three categories, and average the lengths of all three categories (and give total number of rods, total length of all rods, and total of all averages). My professor also wants the program to display an error (but continue working) if the data set continues less than or more than 20 metal rods and he wants each data entry to display on the screen immediately following its entry to ensure accuracy of entry. (phew...that's a lot of background!). Anyhow, I've attached my programmed below - I couldn't get it to copy-paste, no matter how many which ways I did the whole tags things. It just kept giving me errors and not letting my post. I think I am just cursed today in general.

The problem is that I can't even get the program to run as is! I get an error telling me that the program is expecting a ; before the { of my else if statement, but I know that it incorrect (and if I put one in, it just makes even more errors!) I have spent quite a few hours trying to reformat the code thinking I must be overlooking something. I even went as far as to break all of my printf functions into separate lines (annoying, I know) just to be sure that I hadn't missed some tiny punctuation mark that was throwing off the whole darn code. Even if someone can just point me to the line or in the right direction, I would be truly grateful as I really don't know what I am missing here!

Thanks so much!code.txt