Explain the do - while statement - computer programming, Programming Languages

Assignment Help:

Explain the Do - While Statement - Computer Programming?

A do - while loop is an exit controlled loop and the body of the loop gets executed at least once if the condition is not satisfied.

The universal form is

            do

            {

                        statements;

            }

            while(expression);

While the control reaches the do statement the program proceeds to evaluate the body of the loop first At the end of the body of the loop first and At the end of the body of the loop the while statement is evaluated. If the condition is true after that the body of the loop will be executed again. This will go on until the condition becomes false.

This is very alike to the while loop except that the test occurs at the end of the loop body. This guarantees that the loop is executed at least once before continuing. Such a setup is often used where data is to be read. The test after that verifies the data, and loops back to read again if it was unacceptable.

do

{      

printf("Enter 1 for yes, 0 for no :");

                        scanf("%d", &input_value);

}

while (input_value != 1 && input_value != 0);


Related Discussions:- Explain the do - while statement - computer programming

Solve the given initial value problem, Solve the following initial value pr...

Solve the following initial value problem y (3) - 5y'' - 22y' + 56 y= 0;       y(0) = 1;           y'(0) = -2;         y''(0) = -4 Solution : r 3 - 5r 2 - 22r + 56 = (

Java, program take integer from user and print in alphabets

program take integer from user and print in alphabets

Triple eigenvalue with one eigenvector, Triple Eigenvalue with 1 Eigenvecto...

Triple Eigenvalue with 1 Eigenvector The eigenvalue/vector pair in this case are l and  ?h , . Since the eigenvalue is real we know as the first solution we require is, e l

Design and create a new class, You are to design and create a new class cal...

You are to design and create a new class called SelectCallDataDialog, which opens by clicking browse  buttons for selection of ringtones,  vibrations or leds. Depending on which th

Count the total number of records in data table, Normal 0 false...

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

General Programming , #questCustomers of a particular restaurant are descri...

#questCustomers of a particular restaurant are described with some categories. If the categories indicate the customer is a senior citizen, or the customer works for the restaurant

Windows workflow foundation, Windows Workflow Foundation Microsoft windows ...

Windows Workflow Foundation Microsoft windows Work-flows foundation (WF) is an Enthusiasm technological innovation that provides an API, an in-process workflow website, and a rehos

Application in pascal language for free pascal compiler , Before I describ...

Before I describe what you are supposed to do, please remember that this programming assignment is NOT a group project. You are NOT allowed to do this with anyone else's help. This

New features of visual studio 2008, New Features of Visual Studio 2008 1. L...

New Features of Visual Studio 2008 1. LINQ Support LINQ primarily is the structure of many conventional question employees that allow you to perform with information in a more user

Nature of the empirical data in pascal programming, You will soon receive i...

You will soon receive in an email a personalized assignment that tells you the nature of the "Empirical Data" you are to produce with a Pascal program for HW3. HW3 is about generat

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd