Difference between revisions of "SHIP:Sail:Flow Control:do"

From Serious Documentation
Jump to: navigation, search
Line 4: Line 4:
 
*[[SHIP:Sail:Flow_Control:while|while]]
 
*[[SHIP:Sail:Flow_Control:while|while]]
  
== [[Flow_Control:do|do]] ==
+
== [[SHIP:Sail:Flow_Control|do]] ==
 
<onlyinclude>A loop control construct that guarantees the loop executes at least one time.
 
<onlyinclude>A loop control construct that guarantees the loop executes at least one time.
  
Line 11: Line 11:
 
! scope="col" style="text-align:left" | Description
 
! scope="col" style="text-align:left" | Description
 
|-
 
|-
|[[Flow_Control:do|do]]||Starts a loop control which executes once before being evaluated for termination via while statement.
+
|[[SHIP:Sail:Flow_Control|do]]||Starts a loop control which executes once before being evaluated for termination via while statement.
 
|}</onlyinclude>
 
|}</onlyinclude>
 
== Example ==
 
== Example ==

Revision as of 11:55, 10 October 2016

See Also

do

A loop control construct that guarantees the loop executes at least one time.

Statement Description
do Starts a loop control which executes once before being evaluated for termination via while statement.

Example

a = 10;
do {
   printf("%d,", a);
   if(a == 10)
      break;
}while(a);

Prints: 10