Questions


July 2021 1 21 Report


Question: 6's Treat

We are going to play a game called 6’s treat. In this, we take 2 numbers and print the larger number. However, if the 2 values have the same remainder when divided by 6, then we print the smaller value. However, in all cases, if the two values are the same, we print 0.

Write a method Met that takes in 2 integer values and prints the result as per 6’s treat.

Only write the method - assume that the Class & main method have been defined.

Use the System.out.println() statement for printing.

Example Input: 1 7
Output: 1
Example Input: 35 28
Output: 35
Example Input: 44 44
Output: 0

Answers & Comments


Add an Answer


Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Helpful Social

Copyright © 2024 EHUB.TIPS team's - All rights reserved.