C++ Program of Filling and Printing an Array

ad+1

In this program we are declaring an array of 10. And then we are using For Loop to take input from user of each element of array. And then we are printing each element of the array using another For Loop.

 Program:

// Program By http://solutionscpp.blogspot.com
// Author Mansoor Ahmed
// GMail ID: secguy000@gmail.com

#include<iostream>
using namespace std;

int main()
{
    int a[10];
   
    for(int i=0; i<10; i++)
    {
        cout<<"Enter " <<i <<" Element of array: ";
        cin>>a[i];
    }
   
    for(int j=0; j<10; j++)
    {
        cout<<j <<" Element of array is: " <<a[j] <<endl;
    }

}

Output:

1 comment: Leave Your Comments

  1. I found nice article in your blog.thank you for useful info
    welookups

    ReplyDelete