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

Java, program take integer from user and print in alphabets

program take integer from user and print in alphabets

Algorithm to compute a minimum cover time and space, Given strings s 1 and...

Given strings s 1 and s 2 of lengths m and n respectively, a minimum cover of s 1 by s 2 is a decomposition s1 = w 1 w 2 .... wk, where each w i is a non-empty substring of s

How will you add styles to a document, Question 1 How will you add styles ...

Question 1 How will you add styles to a document? Question2 How will you view XML in different ways? Question 3 Explain various file handling mechanism available in PERL

Programming logic???, write c++ source code to find the number of digits i...

write c++ source code to find the number of digits in a given integer? pls ans

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

Program on car purchasing simulation, Introduction A new online syst...

Introduction A new online system for purchasing carsis being designed and you have been contracted to write a C# console application program that models the proposed functio

What is cisc & risc?, Question 1 What is CISC & RISC? Explain their addres...

Question 1 What is CISC & RISC? Explain their addressing modes Question 2 Discuss the following- Design Specification of Assembler Design of Single Pass Assembler

List recursion to de ne the function, Use list recursion to de ne the funct...

Use list recursion to de ne the function mySum which takes as input an integer and a list of integers and returns the list obtained by adding every element of the list by the rst

3 halves, #1. Every mathematics student likes primes numbers. Every mathema...

#1. Every mathematics student likes primes numbers. Every mathematics student like parabolas. Let''s put them together to have some fun: Consider two natural numbers a and b. Of co

Write a program to display some data in bar graph form, Write a program to ...

Write a program to display some data in bar graph form. Have at least 20 elements, which can be positive or negative; draw each element with a vertical bar, going up if the data is

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