In this program, you'll learn to perform basic operations on Array.
#include<iostream>
using namespace std;
int main()
{
int a[10], i;
cout<<"Enter 10 array elements\n";
/* Input array elements */
for(i=0; i<10; i++)
cin>>a[i];
/* Modify array elements */
for(i=0; i<10; i++)
{
a[i] = a[i] + 1;
}
/* Printing array elements */
cout<<"After modifying array elements are\n";
for(i=0; i<10; i++)
{
cout<<a[i]<<" ";
}
return 0;
}
Enter 10 array elements
45 21 32 50 12 47 23 65 4 9
After modifying array elements are
46 22 33 51 13 48 24 66 5 10