Basically you can use any loop in your program , but each has some conditions ;by the help of these you can understand its use .
for loop is use for perfect time means you will know that how many time your loop need to run after that you will get its desired value for example: if you want to print 1-10 digits that means you need to run your loop ten times .
While loop is use, when you not know at which value you get your desired output
Hi there! I am Founder at devtantra and programming enthusiast. My skills includes Android, iOS, PHP, React JS and ReactNative and lot more. If you have any idea that you would want me to develop? Let’s talk: email@example.com with subject Devtantra