I want to write the numbers 1-10 to two different files. I guess I should use the for loop to both print to the files and count from 1 to 10 as it loops but I don't know how.
Count to 10:
Write to two files:
Count to 10 and write the output to two files:
To do this with a for loop, you use the loop counter to write the number.
A complete example in C: