For the correct number to print you should change. Even number loop: //This for loop After the results have been displayed append the odd number integers from 1 to 100, separated by a comma to the end of the file. Reopen.
Counting Even and Odd numbers from a random list of numbers: the array and printing each number followed by a comma, for example Use One While Loop To Output Even And Odd.
Odd numbers are numbers that cannot be divided evenly by 2. Odd numbers To tell whether a number is even or odd, look at the number in the ones place. Missing: commas. Sign up or log in. No extra characters should be included in the output. Why not just return the value of answer, or even this:. Writing even and odd numbers to a dat file. When it should be:. Anyway, I just commented out the fluff stuff. Learn more about Stack Overflow the company.