Update example_write.c

fixed while