Read a set of positive interger numbers from the keyboard. Count the frequency o
ID: 3628862 • Letter: R
Question
Read a set of positive interger numbers from the keyboard. Count the frequency of "1","2","3". Also count the total number of numbers. Note there may be other numbers in the list. Output your results as follows:The number of 1s = 9999
The number of 2s = 9999
The number of 3s = 9999
Total number of numbers = 9999
The seminal or flag number will be a negative number. 9999 stands for whatever number you find.
Test your program with following data
1,3,6,8,2,9,2,1,3,6,9,1,2,3,7,9,4,3,5,1,-99
Explanation / Answer
Dear Friend here is the program u want PLEASE RATE #include using namespace std; void main() { int num; int count[4]={0}; cin>>num; while(num>0) { (count[0])++; if(num==1) (count[1])++; else if(num==2) (count[2])++; else if(num==3) (count[3])++; cin>>num; } coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.