Answer:
code:
#include<iostream>
using namespace std;
int main()
{
//declare an array of size 5
int array[5];
cout<<"Enter the numbers"<<endl;
//applying the for loop
for(int i=0;i<5;i++)
{
//taking the input from user
cin>>array[i];
}
cout<<"The Entered numbers are : "<<endl;
for(int i=0;i<5;i++)
{
//displaying the output
cout<<array[i]<<", "<<endl;
}
return 0;
}
Step-by-step explanation:
First of all you will declare an array of size 5
then you are going to apply the for loop logic where you will take input from the user
again you will apply the for loop to print the entered numbers on screen