Simply Array Question

Hey, guys so I have to enter the multiples of 15 for values 1-10 into my second Array. So for 1 = 15, 2 = 30 and so on. I would then call upon a function which would return the values for each entered array. Such as ValueA[0] = 1. But you can ignore the last part I just need to figure out how to get the multiples into my second array. Thanks.

1
2
3
4
5
6
7
8
int main() {
    int LArray[10] = {1,2,3,4,5,6,7,8,9,10};

    int LArray2[10] = {0,0,0,0,0,0,0,0,0,0};
        for (int i = 1; i <= 10; i++) {
            LArray2[1] = i*15;
            cout << i << " " << LArray2[1] << endl;
        }
1
2
3
4
5
6
7
8
9
int main() {
    const int N = 10;
    int LArray[N] = {1,2,3,4,5,6,7,8,9,10};

    int LArray2[N] = {};
        for (int i = 0; i < N; i++) {
            LArray2[i] = LArray[i] * 15;
            cout << i << " " << LArray2[i] << endl;
        }
Topic archived. No new replies allowed.