Semicolons terminate the statement. It is optional. Some statements that are well formed when a newline is parsed will be considered complete. The statement should be terminated with a semicolon.
Above both code is working fine.
Comment syntax is the same as in C++ and many other languages.