I need to know how to take the variable I have for random to check it's value and say how many times each number 0-9 occur within the 500 generated numbers
#include<iostream>
#include<vector>
usingnamespace std;
vector<int>random()
{
vector<int>num(500);//this holds the 500 random numbers
for (int i=0; 500>i; i++)// generates 500 random numbers and stores them in rawr
{
num[i]=(rand()%10);
}
return(num);
void occ(vector<int>&random)//takes in the numbers
{
int a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0, j=0;//counters for 0-9
vector<int>mult(10);
for (int t = 0; t < mult; t++)//count number of occurences
{
if (random==0)//adds one to the number of occurences
a++;
if (random==1)//adds one to the number of occurences
b++;
if (random==2)//adds one to the number of occurences
c++;
if (random==3)//adds one to the number of occurences
d++;
if (random==4)//adds one to the number of occurences
e++;
if (random==5)//adds one to the number of occurences
f++;
if(random==6)//adds one to the number of occurences
g++;
if (random==7)//adds one to the number of occurences
h++;
if (random==8)//adds one to the number of occurences
i++;
if (random==9)//adds one to the number of occurences
j++;
}
int main()
{
int un;
vector<int>random(500);
return(0);
}