#include<iostre am.h>
main ()
{
int number[10] = {0,1,2,3,4,5,6, 7,8,9};
int x;
for (x=0; x<20; x++)
{
cout << "Input number (only input 0-9): " << endl;
cin >> number[x];
}
for (x=0; x<10; x++)
{
cout << "Occurency of " << number[x] << endl;
}
return 0;
}
i don't have enough knowledge for array.. so help in this problem thanks.. the problem is "the user must input 20 number but only 0-9. after the user input 20 numbers the occurency of number 0-9 must be calculated how many did the user input 0-9.. please help me guys.. :D
main ()
{
int number[10] = {0,1,2,3,4,5,6, 7,8,9};
int x;
for (x=0; x<20; x++)
{
cout << "Input number (only input 0-9): " << endl;
cin >> number[x];
}
for (x=0; x<10; x++)
{
cout << "Occurency of " << number[x] << endl;
}
return 0;
}
i don't have enough knowledge for array.. so help in this problem thanks.. the problem is "the user must input 20 number but only 0-9. after the user input 20 numbers the occurency of number 0-9 must be calculated how many did the user input 0-9.. please help me guys.. :D
Comment