I have a do loop, which schematically looks like this
int iterations = 0 ;
do {
iterations += 1 ;
printf("iterations\t%d\n", iterations) ;
somefunction(does something) ;
} while (some condition) ;
printf("done iterating\n") ;
When I use the format iterations\t%d\n" (line terminated with \n), for each iteration the iteration number is printed to stdout (which in this case is the terminal screen). When instead I use "iterations\t%d\t" (terminated with \t) the iteration number for each iteration is only printed to standard out once I reach the line printf("done iterating\n").
My question is: do I always need to terminate a string with "\n" to print to stdout? I'm confused as my understanding is that when I print to file using fprintf("\n"), I do not need to use any "\n" at the end of the string I am printing to file with for fprintf("") to successfully print to file.