#include < stdio.h >
#include < stdlib.h >
int main(int num, char * arr[]) {
while (printf("%d\n", num++) != 4) {}
}
This is happening because printf returns the number of characters printed.So we want to print upto three characters and plus new line character.So the loop will run until the printf does
return 4.