This was an interesting puzzle from a training on C++ Standard Template Library. Just as the title says, can you write a "Hello World!" program without using any semicolon ;
?
It turns out the answer is yes. Hint: the condition of an if
statement is always evaluated, including all the side effects.
#include <iostream>
int main() {
if (std::cout << "Hello World!") {}
}