Do...Loop...While:
This loop executes one or more statements while the given condition is true. this loop is similar to the Do...While...Loop but the difference of Do...While...loop and Do...loop...is that it first execute the statement and then check the condition. By this loop statement execute once even the condition is false.So this loop should be used when we want to execute the statement at least once.Syntax:
The syntax of this loop is as follows:
Do
Statement(s)
Statement(s)
Statement(s)
Loop While condition
Loop While condition
Flow Chart:
The flow chart of D...Loop...While is as follows:
Example:
Write a program that gets a number from user and display the table of that number.
- Start a new standard EXE project.
- Design the form as follows.
- double click the click event of input button and write following code.
No comments:
Post a Comment