What needs to be added to a do while loop so that it will function exactly like a while loop?

I know the difference between a while loop and a do while loop but not sure how to make a do while loop function exaclty like a while loop.
Adding the removal of the "do" will do the trick.
in while loop : first check the expression and if its true then run the loop but
int do while loop : first run the loop then check the expression so in the do while loop At least run the one loop ( sorry for my eng language :D )
note in all of the loop statement run the loop until the expression is true !!!!
you can do some fun with your cpp compiler :D
check it
1
2
3
4
5
6
7
8
9
10
11
12
13
#define repeat do
#define until( exp ) while ( !(exp) )

void main()
{
	int i = 0;
	repeat
	{
		cout << "hello" << endl;
		i++;
	}
	until ( i == 10 );
}
Topic archived. No new replies allowed.