Difference between for loop and while loop - DotNet and DataBase

Follow us on Facebook

SQL Server Mountain View Mountain View Mountain View

Sunday, 8 July 2018

Difference between for loop and while loop





While and for both are looping statements which execute the code based on the number of times required.

But the difference is,

In the for loop, we know how many times the code needs to be executed.
while loop is useful when we don't know how many times the code needs to be executed.

No comments:

Post a Comment

x

Get Updates On

Discussion updates

Straight Into Your INBOX!

Enter your email address to subscribe to this website and receive notifications of new posts by email.