Choice 2 looks best.
It is best to have only one place that outputs the character, usually at the bottom of the loop. Choice 3 forgets to output the character when it has not been transformed. (I just finished grading some programs where some students made a similar mistake, although with a harder problem than this.)
The output function should match the grain size.
If the grains are characters we need to output characters.
putchar()
writes single characters.
int putchar(int ch)
ch
contains the character to be written as the low-order byte of an int
The function returns the character or EOF
on error.
What happened to the finalize box from the universal flowchart?