18

some people are just worst than the devil.

int main()
{for (int i=0;i<5;i++)
{for(int j=i;j<5;j--)
{printf("*");
}printf("\n");
}
}

(some dude from class wrote that)

Comments
  • 2
    You can't/shouldn't correct everyone. Tell them their mistake if they understand then awesome otherwise leave them be. By the way this dude likes to live dangerously
  • 2
    @py2js i didn't say anything to him, i just asked him politely to write it clearly with indentations so others can read it too
  • 1
    Mistakes happen. If I had seen such a code in production then my eyes would be burning now. I it is a newbie then it is better if we correct their style of coding.
  • 5
    What a noob. There was no need of using those braces.
  • 2
    It's either j++ in the third line, or this code is gonna print ~2^16 stars per line (assuming 4 byte integer) for 5 lines I guess (if first line prints x stars, next line prints x+1 stars and so on)
  • 1
    Also, you did the right thing by suggesting him to try indenting his code for readability instead of lashing out or outright denying to see his code. Good job! 😄
  • 0
    @guthix42 it's exactly the code, i took the pictures 😪😪
  • 1
    @silverstar yeah he's a newbie
  • 0
    Just press ctrl alt L or whatever and he good to go
Add Comment