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 answer

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