I've managed to write up two lovely, wonderfully working programs that calculate, respectively, linear and quadratic equations. However, there are problems when I try to combine the two. If I put them in a while loop, or even an if statement (necessary to give the user a choice between linear and quadratic), the program will display the first printf line of the function and ignore the rest, going back to the loop, or ending the program. Any idea why it does this or how to fix it? I'm using the Linux GCC i686 compiler, but this code shouldn't be OS-specific.
If it's helpful, I've attached a copy of one of the offending programs. The code under the primary 'if' statements are basically exactly the same as the two programs I've already written that work perfectly (yes, I know the code is somewhat inefficient at parts, but I'm fairly new to C).
Thank you for any help you may be able to give.