do while loop is all languages including java has one drawback that this loop will execute for once under all circumstances even the condition satisfies or not.
it begins with do keyword followed by body of loop and in the end condition.
int i,count=0;
do
{
i++;
count++;
}while(i<9);
System.out.println("Count : "+count);
No comments:
Post a Comment