#include<iostream>
using namespace std;int main(){ int N; int *arr; cout << "enter size of arr(enter N) : "; cin >> N; arr = new int [N]; cout << "enter arr : "; for(int i = 1; i <= N;i++) cin >> arr[i]; cout << "your arr : "; for(int i = 1; i <= N;i++) cout << arr[i] << " " ; for(int i = 1; i <= N;i++) { arr[i] = arr[i] + i ; } cout << endl;
cout << "new arr : "; for(int i = 1; i <= N ;i++) cout << arr[i] << " " ;
}
#include<iostream>
using namespace std;
int main(){
int N;
int *arr;
cout << "enter size of arr(enter N) : ";
cin >> N;
arr = new int [N];
cout << "enter arr : ";
for(int i = 1; i <= N;i++)
cin >> arr[i];
cout << "your arr : ";
for(int i = 1; i <= N;i++)
cout << arr[i] << " " ;
for(int i = 1; i <= N;i++)
{
arr[i] = arr[i] + i ;
}
cout << endl;
cout << "new arr : ";
for(int i = 1; i <= N ;i++)
cout << arr[i] << " " ;
}