how to get the temp of cpu in linux terminal raspberry pi

C++
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$((cpu/1000)) c"
Source

Also in C++: