I am trying to figure out compiling code as cc test.c -o test but it says cc command not found on CentOS 7. Why is that? Does Linux have a compiler (C and C++) installed by default? If not, why not?
You should try this as root user:
yum -y install gcc
sudo yum group install "Development Tools"