CLS is a DOS command, it will only work under (some) windows environments - and then only is the
system
function has not been disabled as it has been in online compilers like OnlineGDB.
You can try this:
printf("\e[1;1H\e[2J");
which will work if your console supports ANSI sequences (some do, some don't)
If that doesn't work, check the compiler documentation for your specific environment.