diff --git a/CyclicRotationArray.cpp b/CyclicRotationArray.cpp new file mode 100644 index 0000000..1513627 --- /dev/null +++ b/CyclicRotationArray.cpp @@ -0,0 +1,25 @@ +#include +using namespace std; + +void rotate(int a[], int n) +{ + int i,temp=a[n-1]; + for(int i=n-1;i>=0;i--) + { + a[i]=a[i-1]; + } + a[0]=temp; +} + +int main() +{ + int n; + cin>>n; + int a[n]; + for(int i=0;i>a[i]; + rotate(a,n); + for(int i=0;i