I'm getting confused a little
why does this code
#include <iostream>
#include <string>
using namespace std;
int main()
{
int n = 1;
do
cout << n << " " ;
while (n++ <= 3);
}
return 1 2 3 4
and this code
#include <iostream>
#include <string>
using namespace std;
int main()
{
int n = 1;
do
cout << n << " " ;
while (++n <= 3);
}
returns just 1 2 3
I mean, in the first code, why does it return 4 when 4 is definitely larger than 3?? and why it stops at 3 in the second code :/ confusing