Do while loops are useful where loop is to be executed at least once. In do while loop condition comes after the body of loop.This loop executes one or more statements while the given condition is true.
Syntaxinitialization
do
{
statement(s);
increment/decrement;
}
while (condition);
Flow chart
Example
#include<stdio.h>
#include<conio.h>
void main (void)
{
int a;
a=1;
clrscr();
do
{
printf("\n %d",a);
a++;
}
while (a<=5);
getch();
}

Brilliant Effort Aleena batool.........keep it up
ReplyDeletewish u gud luck
thanks alot :)
ReplyDelete