user51274: I have seen the following code on the Internet:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(8,9);
void setup()
{
  mySerial.begin(9600);    
  Serial.begin(9600);   
  delay(100);
}
void loop()
{
  if (Serial.available()>0)
  mySerial.write(Serial.read());
  if (mySerial.available()>0)
  Serial.write(mySerial.read());
}

The command works perfectly fine. How was it possible in the code to write the command without ";" at the end of the line?
The link to the code is: enter link description here

user4143: Do you refer to this block? 
if (Serial.available()>0)   <- here
mySerial.write(Serial.read());
if (mySerial.available()>0) <- here
Serial.write(mySerial.read());

If so, there is a ; at the end of each command. The commands are just split onto two lines each.  It could be written like this:
if (Serial.available()>0) mySerial.write(Serial.read());
if (mySerial.available()>0) Serial.write(mySerial.read());

The second and fourth lines are the body of the if.  Better indenting with the original arrangement would be:
if (Serial.available()>0)
    mySerial.write(Serial.read());
if (mySerial.available()>0)
    Serial.write(mySerial.read());

Or even better, include the brackets around the body:
if (Serial.available()>0) {
    mySerial.write(Serial.read());
}
if (mySerial.available()>0) {
    Serial.write(mySerial.read());
}


51274: <p>I have seen the following code on the Internet:</p>

<pre><code>#include &lt;SoftwareSerial.h&gt;
SoftwareSerial mySerial(8,9);
void setup()
{
  mySerial.begin(9600);    
  Serial.begin(9600);   
  delay(100);
}
void loop()
{
  if (Serial.available()&gt;0)
  mySerial.write(Serial.read());
  if (mySerial.available()&gt;0)
  Serial.write(mySerial.read());
}
</code></pre>

<p>The command works perfectly fine. How was it possible in the code to write the command without ";" at the end of the line?</p>

<p>The link to the code is: <a href="https://roboindia.com/tutorials/send_receive_data_hc10_bluetooth" rel="nofollow noreferrer">enter link description here</a></p>
 4143: <p>Do you refer to this block? </p>

<pre><code>if (Serial.available()&gt;0)   &lt;- here
mySerial.write(Serial.read());
if (mySerial.available()&gt;0) &lt;- here
Serial.write(mySerial.read());
</code></pre>

<p>If so, there <em>is</em> a <code>;</code> at the end of each command. The commands are just split onto two lines each.  It could be written like this:</p>

<pre><code>if (Serial.available()&gt;0) mySerial.write(Serial.read());
if (mySerial.available()&gt;0) Serial.write(mySerial.read());
</code></pre>

<p>The second and fourth lines are the body of the <code>if</code>.  Better indenting with the original arrangement would be:</p>

<pre><code>if (Serial.available()&gt;0)
    mySerial.write(Serial.read());
if (mySerial.available()&gt;0)
    Serial.write(mySerial.read());
</code></pre>

<p>Or even better, include the brackets around the body:</p>

<pre><code>if (Serial.available()&gt;0) {
    mySerial.write(Serial.read());
}
if (mySerial.available()&gt;0) {
    Serial.write(mySerial.read());
}
</code></pre>
