Make a program in C ++ that displays on the screen the numbers from 1 to 1000, relying on these two, but without using the semicolon .
I have already made a sketch here but I have to choose between 1 or 1000.
Complementing, my code:
#include <iostream>
int main(int x = 0) {
while (x <= 1000 && std::cout << x++ << std::endl) {}
}
Why does not it display the number 1
? Guys, here, for example; link , the output is correct. Could anyone explain to me why g ++ display from 2
?