Advertisement
apl-mhd

CyclicRotation

Aug 6th, 2016
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int arr();
  4.  
  5. int main(){
  6.  
  7.  
  8.  
  9.     int A[5] = {3, 8, 9, 7, 6};
  10.  
  11.     int i, j, temp;
  12.  
  13.  
  14.     for(i = 0; i < 1; i++ ){
  15.  
  16.         temp = A[4];
  17.  
  18.         for( j = 4; j >= 1; j--){
  19.  
  20.             A [j] = A[j-1];
  21.  
  22.  
  23.  
  24.  
  25.             //printf(" %d ", j);
  26.         }
  27.  
  28.         A[0] = temp;
  29.  
  30.           // printf(" %d %d %d %d %d \n", A[0],A[1],A[2],A[3],A[4]);
  31.  
  32.  
  33.     }
  34.  
  35.  
  36.  
  37.  
  38.     return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement