Ask Question
21 August, 15:56

Write a method isMultiple that determines, for a pair of integers, whether the second integer is a multiple of the first. The method should take two integer arguments and return 1 if the second is a multiple of the first and 0 otherwise.

+5
Answers (1)
  1. 21 August, 19:01
    0
    I don't know what language you want it in but I will write this in Java.

    public int isMultiple (int x, int y) {

    if (x % y = = 0)

    return 1;

    return 0;

    }

    The mod function (%) returns 0 iff x divides y.

    Feel free to ask me questions!
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a method isMultiple that determines, for a pair of integers, whether the second integer is a multiple of the first. The method should ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers