Created
January 21, 2021 21:02
-
-
Save pcnoic/59f48e4a63cc8b02f63f7b1aab502624 to your computer and use it in GitHub Desktop.
for loops for finding all combinations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (j = 1; j <= n; j++) { | |
for (i = 0; i < n-1; i++) { | |
temp = num[i]; | |
num[i] = num[i+1]; | |
num[i+1] = temp; | |
print(num, n); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment