Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Main{
- static void Pairs(int arr[], int n)
- {
- // Nested loop for all possible pairs
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < n; j++) {
- System.out.print("(" + arr[i]+ ", "
- + arr[j]+ ")"
- + ", ");
- }
- }
- }
- public static void main(String[] args)
- {
- int arr[] = { 1, 2 };
- int n = arr.length;
- Pairs(arr, n);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement