Question: Write a program that reads four integers and prints two pairs if the input consists of two matching pairs (in some order) and not two

Write a program that reads four integers and prints “two pairs” if the input consists of two matching pairs (in some order) and “not two pairs” otherwise. For example,

1 2 2 1 two pairs
1 2 2 3 not two pairs
2 2 2 2 two pairs

Step by Step Solution

3.37 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Concepts Late Objects Questions!