VU-CS609 – System Programming Assignment-03 Solution

Solution File

FortiGate 100E Series Data Sheet

#include <stdio.h>

#include <bios.h>

#include <dos.h>

 FILE *fp;

unsigned char buf[512];

unsigned char st[60];

unsigned char headno[10 ];

unsigned char secno[10 ];

unsigned char unsigned char trackno[10 ];

 void main(void)

{

int i;

for (i =0; i<512; i++)

 buf[i] = 0;

printf(“Please Enter Name ot the file”);

gets(st);

fp = fopen(st,”wb”);

printf(“Please Enter Head Number:”);

gets(headno);

printf(“Please Enter Sector Number:”);

 gets(secno);

printf(“Please Enter Track Number”); gets(trackno);

i = biosdisk(2,0×80,atoi(headno),atoi(trackno),atoi(secno),1, buf);

if (*(((char *)(&i))+1)==)

{

fwrite(buf,1,512,fp); fclose(fp);

printf(“Data is Written Successfully on the file”);

}

else

{

printf(“Cannot Read Error”,i);

}

getchar();

}

Be the first to comment

Leave a Reply

Your email address will not be published.


*