How do you convert a for loop into a do while

1
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//maybe something like

int i = lower;

do
{
     if (i%2)
     {
           fprintf(stdout, "%d is even\n", i);
      }
     else
     {
        fprintf(stderr,"Integer defining the upper limit must be greater than the integer defining the lower limit\n");
      }



  i++;
} while (i<= upper)

Topic archived. No new replies allowed.