Need the program to run twice

I wrote a program using three functions. It asks for an integer and then displays a box of stars depending on what the user inputed. I need it to run twice. That is ask the user for an integer, display box and then ask for an integer again and then display that box. Thanks for any help.
1
2
3
4
for (X = 0; X < 2; X++)
{
// All code inside.
}


This will run the code once as X = 0 then again with X = 1 and stop. The following is similar but maybe less confusing for a new programmer:

1
2
3
4
for (X = 1; X < 3; X++)
{
// All code inside.
}
Last edited on
Thanks a lot. Worked perfectly. Seems so obvious once you see it.
Topic archived. No new replies allowed.