What is the output of the following lines of code?

Consider that a file named test.txt contains this line of text:
One line of test text
What is the output of the following lines of code?
$file = “test.txt”;
open (OUT, “<$file”) || (die “cannot open $file: $!”);
seek(OUT, 15,0);
read(OUT,$buffer, 5);
print $buffer. “\n”;
print tell(OUT);

Consider that a file named test.txt contains this line of text:
One line of test text
What is the output of the following lines of code?
$file = “test.txt”;
open (OUT, “<$file”) || (die “cannot open $file: $!”);
seek(OUT, 15,0);
read(OUT,$buffer, 5);
print $buffer. “\n”;
print tell(OUT);

A.
ttext 20

B.
ttex 19

C.
ttext 19

D.
ttex 20



Leave a Reply 0

Your email address will not be published. Required fields are marked *