My program is skipping my if statement, it is suppose to run a menu which after choosing your gas, a user inputs 0-30 seconds and it will spit out a distance traveled in the time through said gas. The only issue is the code jumps past my if statement (located at the very end of the code posted) and ends up spitting out my else (Invalid Time) which is meant for time<0 || time>30.
I left out the other subroutines because they are a mirror to the CO2 subroutine with different co-eff as seen at the beginning. Any help at all would be greatly appreciated, first time taking real programming other than simple HTML / Assembly.
This is why we prefer iostream over stdio. The scanf at line 64 is scanning a float, but you've passed the address of a double. Change line 59 to float CO2_sec;