Https://linuxconfig.org/how-to-install-g-the-c-compiler-on-ubuntu-22-04-lts-jammy-jellyfish-linux

Minor correction:
This is missing an #include at step 3.

Should have iostream here:
#include