#include
using namespace std;
int main(int argc, char *argv[])
{
int i=-5;
while(~(i))
{
cout<
'~' is the operator that : ~x = -x-1 and when i = -1, then ~i = 0. if you wonder the value of ~i, you can just print them out:
#include
using namespace std;
int main(int argc, char *argv[])
{
int i=-5;
for (int i = -5; i <= 3; i++)
{
cout<
and then you will find: -5 4 -4 3 -3 2 -2 1 -1 0 0 -1 1 -2 2 -3 3 -4