When I execute the program the console shows 9, 5, 10 as expected. But if I printf the same values, they all turn up 0. I’m sure this is something simple, nonetheless -
yes. %d isn’t “double”, it’s practically integer (“decimal”). if you want floats/doubles, you need a different format code. I won’t tell you because you should have looked up printf to learn about printf-style format strings