Ask questions and get helpful answers.

Write a program to read the names and age of 10 people and print the name of the oldest person.assume that there are no person of the same age.data is supplied in the following form:name,age,name,age

  1. 👍
  2. 👎
  3. 👁
  4. ℹ️
  5. 🚩
1 answer
  1. max = 0
    maxname = ""
    for i=1 to 10
      read name,age
      if age > max then
        max=age
        maxname=name
      end if
    next i
    print "The oldest person is ",maxname

    1. 👍
    2. 👎
    3. ℹ️
    4. 🚩

Answer this Question

Related Questions

Still need help?

You can ask a new question or browse existing questions.