Exit a program c via CMD

0

In the following code, when I press 9 the program should exit:

case 9:
   exit(0);

After pressing 9 the screen below in the cmd is displayed, but after pressing 9 the message: Press to close this window ... and it is necessary to click a key again to close the cmd window. The question is, is there any command that directly closes the cmd window when I press the number 9?

    
asked by anonymous 16.11.2017 / 23:30

1 answer

2
case 9:
break;

So I already left ... Or you can use the command:

system("exit");
    
16.11.2017 / 23:40