0

Is there a way to declare a series of variables like shown using a loop?

int n1,n2,n3,n4,n5,n6,n7,n8,n9,n10;
for (int i = 1 ; i <= 10 ; i++) {
    cout << "Enter number " << i << ": ";
    cin >> n(i);
}

0 Answers0