Hello. I have just began to study arrays and I am trying to write a program, which prints same numbers of stars, with numbers of entered. I have an array where I can enter 8 numbers, which should be from 0 to 15 only. and it should print out same number of starts next to the array element. I thought that I had figured it out, however it prints only one * net to each element and Can you please help me and tell me what can I do about it? Thank you :)
#include <iostream>
#include <math.h>
usingnamespace std;
int main ()
{
int a[8];
for (int i=0;i<8;i++){
cin>>a[i];
}
for (int i=0;i<15;i++){
cout<<a[i]<<"*";
}
}