I am having trouble with an exercise of finding how many times a number appears in an array and display the value and the count of times it appears in the list. The array can be the size of 100.
xjim72
0
Newbie Poster
Recommended Answers
Jump to Post1. put all the numbers in an array and short it.
2. create a 2d array, the first dimension contains the number and the second dimension contains a count of the number of times the number appears. The program will have to iterate through the original array (#1 above) and …
Jump to Postsuggestion: read the 100 numbers from a file instead of entering them from the keyboard.
#include<iostream> #include<iomanip> using namespace std; //function prototypes void initialize (int numbers[], int listSize); void readNum (int numbers[], int& listSize); void selectSort (int numbers[], int listSize); int main() { int Numbers [100]; int …
All 6 Replies
xjim72
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
xjim72
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
dwks
149
Posting Whiz in Training
xjim72
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.