Question: We have an array of 20 integer elements which is supposed to contain the values from 1 to 20. User may not input all the number and skip a few, duplicating the same number for many times. For examples user misses 9 and enters 2 in place of 9, so 2 is entered twice in the array. Your task is to determine the missing values in the array of 20 elements and display all those values on console. For example; in array of 10 elements, A={2,3,5,7,8,4,1,5,5,2) Missing elements are: 6,9,10

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 22PE
icon
Related questions
Question

Write a code

Question:
We have an array of 20 integer elements which is supposed to contain the values from 1 to 20.
User may not input all the number and skip a few, duplicating the same number for many times.
For examples user misses 9 and enters 2 in place of 9, so 2 is entered twice in the array.
Your task is to determine the missing values in the array of 20 elements and display all those
values on console.
For example; in array of 10 elements,
A={2,3,5,7,8,4,1,5,5,2)
Missing elements are: 6,9,10
Transcribed Image Text:Question: We have an array of 20 integer elements which is supposed to contain the values from 1 to 20. User may not input all the number and skip a few, duplicating the same number for many times. For examples user misses 9 and enters 2 in place of 9, so 2 is entered twice in the array. Your task is to determine the missing values in the array of 20 elements and display all those values on console. For example; in array of 10 elements, A={2,3,5,7,8,4,1,5,5,2) Missing elements are: 6,9,10
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
C-string
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT