Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int input=0;
  7.     int array[6]={1,2,3,4,5,8};
  8.     for(int i=0;i<5;i++){
  9.         cout<<array[i]<<" ";    
  10.     }
  11.     cout<<endl;
  12.     cin>>input;
  13.     for(int g=0;g<input;g++){
  14.         array[6]=array[0];
  15.         for(int count=1;count<6;count++){
  16.             array[count-1]=array[count];
  17.         }
  18.     }
  19.     for(int print=0;print<5;print++){
  20.         cout<<array[print]<<" ";
  21.     }
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement