Help me with the while loop

And also help me with the do while loop, I know the for loop, and I have doscovered that the while loop is an if statement, can 'else' be used in a while statement? Is while like if?


if the condition is true the statements are executed? What is the difference between the while and do while loops? is it the 'do'?




Comments

  • There's really not that much of a difference between the while and the do while. The while says

    while

    {

    //the while starts here and

    //ends here

    }


    the do while just says

    do

    {

    //do this

    }while (doing this);


    but the for loop is the best to use, if you know it the stick with it. You can use a if and else in the while and do while.








    : And also help me with the do while loop, I know the for loop, and I have doscovered that the while loop is an if statement, can 'else' be used in a while statement? Is while like if?


    : if the condition is true the statements are executed? What is the difference between the while and do while loops? is it the 'do'?





Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories