Hello World!
The first program anyone ever writes.
// Print to the console
console.log("Hello World!");// Write to the main document (this adds to whatever is already there)
document.write("Hello World!");
// OR you can overwrite the entire document
document.documentElement.innerHTML = "Hello World!";# Print output
print("Hello World!")// Header file for IO (we are "including it" in our code)
#include<iostream>
// Utilizing the "standard" namespace, so we don't have to say "std" every time.
using namespace std;
// C++ programs need a main function where the code begins
int main() {
// Let's finally print to std out
cout << "Hello World";
// The main function has to return something
return 0;
} Last updated