I can't understand why following code works like this..I mean: instead of printing "hello" after each one second delay...it wait 5 second and display hellohellohellohellohello
at once.
#include <stdio.h>
int i;
for(i=0; i<5; i++) {
printf("hello");
sleep(1);
}