Write a program that reads in ten numbers and displays the number of distinct numbers and the distinct numbers separated by exactly one space (i.e., if a number appears multiple times, it is displayed only once). (Hint:Read a number and store it to an array if it is new. If the number is already in the array, ignore it. While solving the question please use an array.) After the input, the array contains the distinct numbers. Here is the sample run of the program: Enter ten numbers: 123216345 2 The number of distinct number is 6. The distinct numbers are: 123645

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter16: Searching, Sorting And Vector Type
Section: Chapter Questions
Problem 21PE
icon
Related questions
Question
Write a program that reads in ten numbers and displays the number of distinct numbers and
the distinct numbers separated by exactly one space (i.e., if a number appears multiple times,
it is displayed only once). (Hint:Read a number and store it to an array if it is new. If the number
is already in the array, ignore it. While solving the question please use an array.) After the
input, the array contains the distinct numbers. Here is the sample run of the program:
Enter ten numbers: 1 2 3 21634 5 2
The number of distinct number is 6.
The distinct numbers are: 123645
Transcribed Image Text:Write a program that reads in ten numbers and displays the number of distinct numbers and the distinct numbers separated by exactly one space (i.e., if a number appears multiple times, it is displayed only once). (Hint:Read a number and store it to an array if it is new. If the number is already in the array, ignore it. While solving the question please use an array.) After the input, the array contains the distinct numbers. Here is the sample run of the program: Enter ten numbers: 1 2 3 21634 5 2 The number of distinct number is 6. The distinct numbers are: 123645
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning