exit - Terminate the Program in C

exit() Terminate the program:
The exit() function is used to terminate program execution and to return to the operating system. The return code "0" exits a program without any error message, but other codes indicate that the system can handle the error messages.


Syntax:
void exit(int return_code);


#include <stdlib.h>
  #include <stdio.h>

  int main()
  {
    char choice;
    choice = getchar();
    if(choice=='Q') 
    {exit(0);
    }else
    {
     printf("Forget Code Retains");
}

    return 0;
  }