Ask Question
27 May, 11:45

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.

+1
Answers (1)
  1. 27 May, 14:03
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers