I am nearly finished with a program that I am writing for a class, and can't for the life of me figure out why the output of this function isn't displayed properly. This function should display up to 10 terms per line before beginning a new line. However, the output seems to be random. Can anyone tell me why this is displaying incorrectly? Please see code below.
The weirdness is due to my professor generally not accepting "hard coded" values. So, I made global constants for the values that I needed.
As for a brief example of the output I'm getting:
Series generated for 100
100 50 25 76 38 19 58 29 88 44
22 11 34 17 52 26 13 40 20
10 5 16 8 4 2 1
Total number of terms: 26
Series generated for 300
300 150 75
226 113 ... continues for a total of 9 terms on this line.
When it should be:
Series generated for 100
100 50 25 76 38 19 58 29 88 44
22 11 34 17 52 26 13 40 20 10
5 16 8 4 2 1
Total number of terms: 26
Series generated for 300
300 150 75 226 113 ... continues for a total of 10 terms on this line.