Table of Contents

    While Loop in Programming Language

    The while loop continues to execute as long as a specified condition evaluates to true. It is useful when the number of iterations is not known in advance.


    Flowchart

    While Loop in Programming Language
    Figure: While Loop in Programming Language


    Which loop to use? While or for

    Which loop to use in Programming Language
    Figure: Which loop to use in Programming Language