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

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

Program character array to a signed floating point number, Write a function...

Write a function that converts a character array to a signed floating point number. Function prototype must be as follows: int asciiToFloat( char *str, unsigned char* eflag) Follow

Java string handling, Expertsmind brings you unique solution in java assig...

Expertsmind brings you unique solution in java assignments String Handling Series signifies a sequence of character types. It has set duration of personality sequence. Onc

Define call by value - computer programming, Define Call by value - Compute...

Define Call by value - Computer Programming? Functions are raise by writing their name and an appropriate list of arguments within parenthesis. Usually these arguments are in t

Shell script, program for pyramid in shell script

program for pyramid in shell script

Develop a context diagram and use case diagram, Develop (i) a context diagr...

Develop (i) a context diagram and (ii) a use case diagram to model the following functionalities of NetFlix. Netflix is an online video/DVD renting company. A customer desiring

For loop , I am trying to get right side triangle in visual logic using for...

I am trying to get right side triangle in visual logic using for loop

Write an xslt-flatten the tree, Flatten the tree Consider the followin...

Flatten the tree Consider the following XML input, which groups people into two categories-salaried and hourly: Warren Rosenbaum 37 5.75

Software tools for structuring complex program, This assignment begins soft...

This assignment begins software tools and techniques for structuring complex programs. Use it to become familiar with these facilities, and ensure you use the speci?ed concepts in

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