Function name : system
Header file : <stdlib.h>
Function prototype : int system(char *command);
Function : Used to issue a DOS command
Parameters : char *command is the DOS command to be executed
Return value : 0 on success, -1 on failure
Program example : Use this function to execute DOS commands
#include<stdio.h>#include<stdlib.h>intmain(void){printf(Abouttospawncommand.comandrunaDOScommandn);system(dir);//Execute dos command return0;}
Running results
Abouttospawncommand.comandrunaDOScommand The volume in drive D is the software volume’s serial number and is the directory 2020/07/0100:54<DIR> of C06C-E404D:C-FreeC-Free5workspace. 2020/07/0100:54<DIR>..2020/06/2216:0370a.c2020/06/2216:0318,991a.exe2020/06/2216:033,774a.o2020/06/2922:56411abort.c