Write a Java program that reads in ten numbers and displays the number of distinct numbers and
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a Java program that reads in ten numbers and displays the number of distinct numbers and the distinct numbers separated by exactly one space. In other words, if a number appears multiple times, it is displayed only once.
Hint: Read a number and store it in an array if it is new. If the number is already in the array, ignore it. After the input, the array contains the distinct numbers.
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date: