Programming-Idioms

This language bar is your friend. Select your favorite languages!

Idiom #186 Exit program cleanly

Exit a program cleanly indicating no error to OS

#include <stdlib.h>
exit(EXIT_SUCCESS);
Environment.Exit(0);
  STOP
import "os"
os.Exit(0)
defer os.Exit(0)
import System.Exit
exitSuccess
process.exit()
System.exit(0);
import kotlin.system.exitProcess
exitProcess(0)
require 'os'
os.exit(0)
exit(0);
Halt;
exit;
import sys
sys.exit(0)
exit
use std::process::exit;
fn main() {
  exit(0);
}
sys.exit(0)

Do you know the best way to do this in your language ?
New implementation...

Idiom created by

jazz