expected unqualified-id before 'if'

C++
void loop(){

if(distanceCm < 21){
  digitalWrite(13, HIGH);
}
else{
  digitalWrite(13, LOW);
}
}
Source

Also in C++: