Professional Documents
Culture Documents
appears in the list. You may assume that the data set has at most 100 numbers and -999 marks the end
of the input data. The numbers must be output in increasing order. For example, for the data:
15 40 28 62 95 15 28 13 62 65 48 95 65 62 65
95 95
The output is:
Number Count
13 1
15 2
28 2
40 1
48 1
62 3
65 3
m
er as
95 4
co
eH w
Answer:
o.
rs e
ou urc
#include <iostream>
int main()
vi y re
{
int arr[1000],j;
int k=0;
ed d
cout << "Program that reads a set of positive integers and outputs how many times a particular
ar stu
number appears";
cout << " Enter a set of integers (-999 to stop)" << endl;
sh is
// to input the integer until we get -999 to stop reading the int value.
do
{
cin>> j;
if(j== -999)
break;
arr[j]++;
https://www.coursehero.com/file/78271954/Question-69docx/
k++;
}
while(k<100);
m
er as
co
return 0;
eH w
}
o.
rs e
ou urc
o
aC s
vi y re
ed d
ar stu
sh is
Th
https://www.coursehero.com/file/78271954/Question-69docx/