C++: Program to enter integers in 1D Arrray

Program to enter numbers in an 1-D array of length 5.
#include <iostream>
using namespace std;
int main()
{
int a[5];
cout<<"Enter numbers in array"<<endl;
for(int i=0;i<5;i++){
cin>>a[i];
}
for(int i=0;i<5;i++){
cout<<a[i]<<" ";
}
return 0;
}
In Association with Amazon.in

Comments

Popular Posts

Top 10 Web Sites Every Programmer Should Visit Daily