Type an algorithm to solve the following problem:

You want to read the different ages of a group of people until an age of negative is entered. Based on the ages entered, you should count and print how many of the people are old (above 65), how many are middle-aged (from 40 to 65 (inclusive)), and how many are young (below 40). You should then print the category (old, middle-aged, young) that are the most in the group.

Show me your attempt and I'll show you mine.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.