how to print to the serial monitor arduino

C++
void setup()
{
    Serial.begin( 9600 );
}

void loop()
{
    // This will write to the monitor and end the line
    Serial.println( "test text" );
  
    // This will write to the monitor but will not end the line
    Serial.print( "test text" );
}

Source

Also in C++: