#include "iostream.h"

#include "dos.h"

main()

{

//PROGRAM AIM : to delete a file in all the memory models

      union REGS i,o;

      struct SREGS s;

      char fname[12];

      cout<<"\nEnter file name : ";

      cin>>fname;

      s.ds=FP_SEG(fname);   //segment part of the file name

      i.x.dx=FP_OFF(fname); //offset part of the file name

      i.h.ah=0x41; //service no.

      intdosx(&i,&o,&s);

      cout<<"flag = "<<i.x.cflag;

      if(i.x.cflag==0)

            cout<<"\nfile "<<fname<<" deleted successfully";

      else

            cout<<"\nfile "<<fname<<" could not be deleted";

      return 0;

}