This loop quiet similar to While loop, but here firstly it does action and then check condition.
Synatx:
do
{
//code
} while(condition);
Example:
int i=15;
do
{
i=i-5;
} while(i!=0);
This code will substract '5' from i until it is not equals to '0'.
No comments:
Post a Comment