user3873: I have loaded an example sketch that came with the installation of the Arduino software onto my Uno.
void setup() {
   Serial.begin(9600);
}


void loop() {

  int sensorValue = analogRead(A0);
  Serial.println(sensorValue);
  delay(1);       
}

From this time TX light is continuously on. It's remaining on even after resetting it. How do I end void loop so that TX light goes off.

user3876: Seeing as questions about turning off the LED, and the nature of exiting loop have been answered, I'll also answer the question they both seem to lead to:
If the overall intention is to "turn off" the MCU, outside of turning off the power supply, it can be put into sleep mode. 
Depending on how you configure the MCU before entering sleep mode, it can even be allowed to wake up on further USART communication.

user3883: Don't write code in the loop() that should be executed only a few times. Or use a counter. Or an external button. For the permanent light, increase the delay between calls.

user3466: The TX LED is on, because this sketch is periodically printing the value of the analog pin 0 onto the serial port. The LED seems to be constantly on, because the delay between two Serial.println() calls is only approx. 1 ms. 
If you replace the 1 with 1000 for example, the TX LED should flash once per second. Start the serial monitor in your Arduino IDE too see the transmitted analog values. Delete the Serial. calls to remove the serial port functionality altogether.
You might want to read the documentation of the loop() and the delay() functions.

user313: The implied question is how to turn off the Tx LED, which has already been answered and is probably the answer you're looking for. But the question you asked is how to end the loop() function. Not to be pedantic but to clarify the use of loop, the simple answer is, "you can't". loop() is called from a forever loop in the C/C++ main program, function main(), so returning from it, either with a return statement or by reaching the final close } causes loop() to be called again. This is intentional as the main() function in an embedded system is never supposed to return, thus it must keep re-running the application program.
Update (since this question just reappeared on the front page, I'll add the following to my answer):
loop() reads and prints continuously. If you had wanted that code to be executed only once, you could put in setup() and leave loop() empty. Then the sketch would initialize the serial output, read an analog value, print it - once - followed by entering the empty loop() and remaining there until power-down.
A way to execute the loop function once is to write an infinite loop at the end of it, so loop() would never return and thus never be re-executed:
void loop() {

  int sensorValue = analogRead(A0);
  Serial.println(sensorValue);
  delay(1);

  while(1)
     ;
}


3873: <p>I have loaded an example sketch that came with the installation of the Arduino software onto my Uno.</p>

<pre><code>void setup() {
   Serial.begin(9600);
}


void loop() {

  int sensorValue = analogRead(A0);
  Serial.println(sensorValue);
  delay(1);       
}
</code></pre>

<p>From this time TX light is continuously on. It's remaining on even after resetting it. How do I end <code>void loop</code> so that TX light goes off.</p>
 3876: <p>Seeing as questions about turning off the LED, and the nature of exiting <code>loop</code> have been answered, I'll also answer the question they both seem to lead to:</p>

<p>If the overall intention is to "turn off" the MCU, outside of turning off the power supply, it can be put into <a href="http://playground.arduino.cc/Learning/ArduinoSleepCode" rel="nofollow">sleep mode</a>. </p>

<p>Depending on how you configure the MCU before entering sleep mode, it can even be allowed to wake up on further USART communication.</p>
 3883: <p>Don't write code in the loop() that should be executed only a few times. Or use a counter. Or an external button. For the permanent light, increase the delay between calls.</p>
 3466: <p>The TX LED is on, because this sketch is periodically printing the value of the analog pin 0 onto the serial port. The LED seems to be constantly on, because the delay between two <code>Serial.println()</code> calls is only approx. 1 ms. </p>

<p>If you replace the 1 with 1000 for example, the TX LED should flash once per second. Start the serial monitor in your Arduino IDE too see the transmitted analog values. Delete the <code>Serial.</code> calls to remove the serial port functionality altogether.</p>

<p>You might want to read the documentation of the <a href="http://arduino.cc/en/pmwiki.php?n=Reference/Loop">loop()</a> and the <a href="http://arduino.cc/en/pmwiki.php?n=Reference/Delay">delay()</a> functions.</p>
 313: <p>The implied question is how to turn off the Tx LED, which has already been answered and is probably the answer you're looking for. But the question you asked is how to end the <code>loop()</code> function. Not to be pedantic but to clarify the use of <code>loop</code>, the simple answer is, "you can't". <code>loop()</code> is called from a forever loop in the C/C++ main program, function <code>main()</code>, so returning from it, either with a <code>return</code> statement or by reaching the final close <code>}</code> causes <code>loop()</code> to be called again. This is intentional as the <code>main()</code> function in an embedded system is never supposed to return, thus it must keep re-running the application program.</p>

<p>Update (since this question just reappeared on the front page, I'll add the following to my answer):</p>

<p><code>loop()</code> reads and prints continuously. If you had wanted that code to be executed only once, you could put in <code>setup()</code> and leave <code>loop()</code> empty. Then the sketch would initialize the serial output, read an analog value, print it - once - followed by entering the empty <code>loop()</code> and remaining there until power-down.</p>

<p>A way to execute the loop function once is to write an infinite loop at the end of it, so <code>loop()</code> would never return and thus never be re-executed:</p>

<pre><code>void loop() {

  int sensorValue = analogRead(A0);
  Serial.println(sensorValue);
  delay(1);

  while(1)
     ;
}
</code></pre>
