printf in while loop:
How many times below program will print hello world?
infinite loop and crash.
it loops for only one time. While will loop as long as expression is true. printf returns how many characters have been printed into display buffer successfully. In our case it is +ve number, which means true, but on negating it becomes false, and hence while loop will stop after printing for first time.
Back To Top