can someone help make a loop a do-while loop

i have this loop but i need to make it into a do-while loop, does anyone know how to do that?

int sum = 10;

for(int k = 2; k < 20; k += 3)

{

sum = sum + (2*k);

if(sum > 100)

{

cout << "exceeded 100";

}

}

1
2
3
4
5
6
7
8
9
10
11
12
k = 2;
do
{
    sum = sum + (2 * k);

    if(sum > 100)
    {
        cout << "exceeded 100";
    }

    k += 3;
} while(k < 20);
@SakurasouBusters how did you get that?
Topic archived. No new replies allowed.