Ask Question
28 February, 04:50

A file named numbers. txt contains an unknown number of lines, each consisting of a single positive integer. Write some code that reads through the file and stores the largest number read in a variable named maxvalue.

+5
Answers (1)
  1. 28 February, 06:23
    0
    Not a complicated task, but we really need to know which language. Pseudo code would be like:

    maxvalue = 0

    file = open ("numbers. txt", "rb")

    while (not EOF) : #End Of File

    file. readln (value)

    if (value > maxvalue):

    maxvalue = value

    file. close ()
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “A file named numbers. txt contains an unknown number of lines, each consisting of a single positive integer. Write some code that reads ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers