sentence: while loop diagram for example , in the c programming language ( as well as java , c# and c++ , which use the same syntax in this case ) , the code fragment int x = 0 ; while ( x ( 5 ) -lcb- printf ( '' x = % d n '' , x ) ; x + + ; -rcb- first checks whether x is less than 5 , which it is , so then the -lcb- loop body -rcb- is entered , where the printf function is run and x is incremented by 1 .