close
    write an algorithm accept two numbers and display the larger number

    0  Views: 844 Answers: 1 Posted: 13 years ago

    1 Answer

    Here's the first answer:

    (1) read first number
    (2) read second number
    (3) if first is greater, display second, else display first

    The second and third can be done the same way:

    (1) read first number and set highestSeenSoFar to it
    (2) read another number, and if greater than highestSeenSoFar, set highesSeenSoFar to the new number
    (3) repeat step 2 (twice for 3 numbers total, 99 times for 100 numbers)
    (4) display highestSeenSoFar


    Top contributors in Programming & Design category

     
    ROMOS
    Answers: 234 / Questions: 0
    Karma: 11370
     
    Colleen
    Answers: 612 / Questions: 0
    Karma: 10395
     
    country bumpkin
    Answers: 57 / Questions: 0
    Karma: 3660
     
    pythonlover
    Answers: 93 / Questions: 0
    Karma: 2060
    > Top contributors chart

    Unanswered Questions

    keonhacai88futbol
    Answers: 0 Views: 1 Rating: 0
    ICCO T&T
    Answers: 0 Views: 5 Rating: 0
    Bất Động Sản Giá Rẻ
    Answers: 0 Views: 6 Rating: 0
    hitclub97co
    Answers: 0 Views: 7 Rating: 0
    Xoilac TV Trực tiếp bóng đá
    Answers: 0 Views: 14 Rating: 0
    uu88free
    Answers: 0 Views: 11 Rating: 0
    tylekeo
    Answers: 0 Views: 10 Rating: 0
    > More questions...
    558203
    questions
    778997
    answers
    918979
    users