Advertisement
apl-mhd

permutation

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