Question: ( Print distinct integers ) Write a java program that reads in 1 0 integers and displays the number of distinct integers and the distinct

(Print distinct integers)
Write a java program that reads in 10 integers and displays the number of distinct integers and the distinct integers in their input order and separated by exactly one space (i.e., if a number appears multiple times, it is displayed only once).
(Hint: Read an integer and store it to an array if it is new. If the integer is already in the array, ignore it.)
After the input, the array contains the distinct integers. Here is a sample run:
Sample Run
Enter ten numbers: 1232163452
The number of distinct number is 6
The distinct numbers are 123645

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!