Explore BrainMass
Share

Explore BrainMass

    Loops

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    "The do while loop is enough to solve any problem that uses looping and no other repetition structure is required." Discuss this statement by giving examples.

    © BrainMass Inc. brainmass.com October 10, 2019, 4:22 am ad1c9bdddf
    https://brainmass.com/computer-science/programming-languages/457631

    Solution Preview

    The

    do
    {
    loop-body
    } while (condition)

    loop executes the loop body at least once because it checks for the condition later, while

    while (condition)
    {
    loop-body
    }

    and

    for (initialization; condition; condition-related-variable(s)-updation)
    {
    ...

    Solution Summary

    Do-while loop on its own can not handle all the looping requirements but yes, if used in conjunction with if-statement, it can.

    $2.19