ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I would say that the program is fairly ugly (clever maybe but ugly). It is using some characteristics of ASCII to essentially hide the output. The \0 character indicates the end of a string, so essentially nothing is displayed however if a one is displayed before the NUL character then this is treated as the start of heading which is terminated by the \0 and so the rest of the text is displayed. ++y/x will only be one if y is greater than x and that will only occur if x is a prime number, because of the x%y condition will fail if y ever takes on the value that is a factor of x.