C++ Array Program using with loop


In this program, You will learn how to implement Array program using with loop in C++.


for (i = 0; i < 10; i++) {

cin >> arr[i]; }


Example: How to implement Array program using with loop in C++

Run it Now
#include<iostream>
using namespace std;

int main() {

    int arr[10], i;

    cout << "Enter any 10 Numbers :\n";
    for (i = 0; i < 10; i++) {
        cin >> arr[i];
    }

    cout << "\nAll Array is :" << endl;
    for (i = 0; i < 10; i++) {
        cout << arr[i] << "\t";
    }

    return 0;
}

Output:

Enter any 10 Numbers :
10	20	30	40	50	60	70	80	90	100
All Array is :
10	20	30	40	50	60	70	80	90	100