C Program to Check the Status of Floppy_Disk…   Leave a comment

Yesterday.. When i am Play With C..than i made one Program! that can Check the Status Of Floppy_Disk.. Means Check For Bad_Sectors..Bad Tracks etc…

Ok–now see the Code..

NOTE:-

- I have no more Experience on this..that if Problem Occure  than Comment me..

CODE:-

#include <stdio.h>
#include <conio.h>
#include <process.h>
#include <dos.h>

int main(void)
{
int i, strt, ch_out, sector;
char buf[512];

printf(“Insert a diskette into drive A and press any key\n”);
getch();
sector = 0;
if (absread(0, 1, sector, &buf) != 0)
{
perror(“Disk problem”);
getch();
exit(1);
}
printf(“Read OK\n”);
strt = 3;
for (i=0; i<80; i++)
{
ch_out = buf[strt+i];
putchar(ch_out);
}
printf(“\n”);
getch();
return(0);
}

Posted June 22, 2011 by smarthacker5 in C/C++

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 76 other followers

%d bloggers like this: