for (i=0;i<n;i++)
{
    ...
}

The above for structure can be transformed to a while structure:

i=0;
while (i<n)
{
    ...
i++; }

And following while and do-while are equivalent:

do
{
    ...;
}while (b);
{
    ...;
}
while (b)
{
    ...;
}

You have no rights to post comments