I copied this code from crazyprogrammer's blog. If anyone please explain me why the programmer used negative values here?Code:int main() { int i=0, j=0, NUM=3; for(i=-NUM; i<=NUM; i++) { for(j=-NUM; j<=NUM; j++) { if( abs(i)+abs(j)<=NUM) // Change this condition { cout<<"*"; } else { cout<<" ";} } cout<<endl; } return 0; }
I have seen many such great programs on internet without any explanation. I would ask the same question to the programmer himself but he has been inactive on Internet since two years and his blog is dead.