What is the difference between a while loop and a do while loop. I used to think both are completely same but then I came across following line of code:
do { printf("Word length... "); scanf("%d", &wdlen); } while(wdlen<2);
This code works perfectly and also prints word length and tascans the input but, once I changed it to
while(wdlen<2){ printf("Word length... "); scanf("%d", &wdlen); }
It gives a blank screen and fails to work. So there are some functional differences between both the loops. Can anybody explain this to me and also could I know if there is any difference between them?