I am new to C programming. In my program below, I am simply trying to immediately, exit the C program without see any additional dialog, if the programs receives the input "quit".
I am trying to accomplish this using exit(0); however, before the program exits it outputs something like
success
process exited with return value 0
Press any key to continue...
I am trying to avoid this dialog and exit the program immediately. Is this possible?
I appreciate any help with this.
Many thanks in advance!
My C Code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void)  {
    char command1[256], command2[256];
    printf("# ");
    scanf("%s", command1);
    if(strcmp(command1,"quit")==0){
        printf("success");
        exit(0);
    }else{
        printf("unknown command");
    }
system("PAUSE");
return 0;
}
 
     
     
     
     
    