We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

www.vustudents.ning.com

# CS609 Assignment No 03 Spring 2019 Solution & Discussion

CS609 Assignment No 03 Spring 2019 Solution & Discussion

..How to Join Subject Study Groups & Get Helping Material?..

Views: 2084

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

### Replies to This Discussion

Our main purpose here discussion not just Solution

We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions. Read More>>

Discussed & be touched with this discussion. After discussion a perfect solution will come in a result at the end.

“How to Join Subject Study Groups & Get Helping Material”

P.S:    Please always try to add the discussion in proper format title like “CS101 Assignment / GDB No 01 Solution & Discussion Due Date: ___________”

Share below link with friends for solution & Discussion. A Single link for help in your education.

http://bit.ly/vucodes

Site Overview | Assignment Solutions | Past Papers |Site Features

The assignment is similar the example available in Handouts Lecture 26 Page No. 208

A.o.A cs609 3rd assignment solution plz

Problem Statement:
Q: Write a program which reads two physically addressed blocks from disk using biosdisk() function.

#include #include FILE *fp;
unsigned char buf[1024];
unsigned char st[60];
unsigned char secno[10];
unsigned char trackno[10];
void main (void) {
int i ;
for (i=0;i<1024;i++)
buf[i]=0;
gets(st);
fp=fopen(st,"wb");
if (*(((char *)(&i))+1)==0) {
fwrite(buf,2,1024,fp); fclose(fp);
}
else printf("Cannot Read Error# = %x",i);
}

CS609_Assignment_3-Solution_Spring_2019

Attachments:

in this solution after reading the block writing in file but in assignment they ask to read only.

plz koi complete solution uplode kar do word ma

ID:
Problem Statement:
Q: Write a program which reads two physically addressed blocks from disk using biosdisk() function.

#include #include FILE *fp;
unsigned char buf[1024];
unsigned char st[60];
unsigned char secno[10];
unsigned char trackno[10];
void main (void) {
int i ;
for (i=0;i<1024;i++)
buf[i]=0;
gets(st);
fp=fopen(st,"wb");
if (*(((char *)(&i))+1)==0) {
fwrite(buf,2,1024,fp); fclose(fp);
}
else printf("Cannot Read Error# = %x",i);
}

3rd Assignment Cs609

Solution:

#include <bios.h>

#include <dos.h>

FILE *fp;

unsigned char buf[1024];

unsigned char st[60];

unsigned char secno[10];

unsigned char trackno[10];

void main (void)

{

int i;

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

buf[i]=0;

gets(st);

fp=fopeon(st,”wb”);

printf(“/nsector ”);

gets(secno);

puts(secno);

printf(“/ntrack ”);

gets(trackno);

puts(trackno);

i = biosdisk(2, 0x80, atoi(headno), atoi(trackno), atoi(trackno), 2,buf);

}

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

{

fwrite(buf,2,1024,fp);

fclose(fp);

}

else

{

printf(“Cannot Read Error# = %x” i);

}

bhai is main sa correct soltuion kon sa ha??

include <bios.h>

#include <dos.h>

FILE *fp;

unsigned char buf[1024];

unsigned char st[60];

unsigned char secno[10];

unsigned char trackno[10];

void main (void)

{

int i;

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

buf[i]=0;

gets(st);

fp=fopeon(st,”wb”);

printf(“/nsector ”);

gets(secno);

puts(secno);

printf(“/ntrack ”);

gets(trackno);

puts(trackno);

i = biosdisk(2, 0x80, atoi(headno), atoi(trackno), atoi(trackno), 2,buf);

}

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

{

fwrite(buf,2,1024,fp);

fclose(fp);

}

else

{

printf(“Cannot Read Error# = %x” i);

}

ye wala correct hai zain bro

fwrite(buf,2,1024,fp);

fwrite(successfully file read); in ma kon sa thek hai  tariq sir g

## Latest Activity

Nimra Sohail posted a status
"Mere Zindagi Hijr O Wisaal Ka Rangeen Fasana Hai"
31 minutes ago
49 minutes ago
♦_"Tooba"_♦ liked ++"STrAnGeR"++'s discussion #تحریرضرورپڑھیں!!!!
2 hours ago
♦_"Tooba"_♦ liked 2.O's discussion Allah ka hona hi bhut bahter hay
2 hours ago
♦_"Tooba"_♦ liked + M.Tariq Malik's discussion Important Announcement
2 hours ago
♦_"Tooba"_♦ updated their profile
2 hours ago
2 hours ago
♦_"Tooba"_♦ liked ++"STrAnGeR"++'s blog post نقطہ اور نکتہ
2 hours ago

1

2

3