Ask Question
Yesterday, 07:20

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.

+2
Answers (1)
  1. Yesterday, 09:37
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers