Advertisement
Tahamina_Taha

permutation using loop

Aug 6th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. //permutation using loop
  4. {
  5.  
  6.     int a,b,c;
  7.     for (a=1;a<=3;a++){
  8.         for(b=1;b<=3;b++){
  9.             for(c=1;c<=3 ;c++){
  10.                     if(b!=a && b!=c && c!=a){
  11.                 printf("%d,%d,%d\n",a,b,c);
  12.             }
  13.         }
  14.  
  15.     }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement