Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- { const int n=5;
- int a[5]={1,4,2,6,3},i,y[n],z[n],j;
- for (i=0;i<n-1;i++)
- {
- y[i]=a[i+1];
- z[i+1]=a[i];
- }
- y[n-1]=a[0];
- z[0]=a[n-1];
- for(i=0;i<n;i++)
- cout<<y[i]<<' ';
- cout<<endl;
- for (i=0;i<n;i++)
- cout<<z[i]<<' ';
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement