C++: Program to enter integers in 2D Array

Program to enter numbers in 2-D 5*5 array.
#include <iostream>
using namespace std;
int main()
{
int a[5][5];
cout<<"Enter numbers in array"<<endl;
for(int i=0;i<5;i++){
  for(int j=0;j<5;j++){
       cin>>a[i][j];
  }
}
for(int i=0;i<5;i++){
  for(int j=0;j<5;j++){
    cout<<a[i][j]<<" ";
  }
cout<<endl;
}
return 0;
}

Comments

Popular Posts

Top 10 Web Sites Every Programmer Should Visit Daily