answersLogoWhite

0


Best Answer

The details will vary, depending on the programming language. To decide whether m is a multiple of n, you can do one of the following:

Check whether m % n = 0; the "%" operator calculates the remainder. If this remainder is zero, then it is a multiple.

Calculate m / n; check whether the result is a whole number, for example: m / n = int(m / n). Here, especially, the details vary depending on the language; for example, in Java m / n will do an integer division, so you'll get an integer whether it is divisible or not. In this case, you can multiply the result back with "n", and see whether it is equal to "m"; but just using the "%" operator is simpler in this case.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program to read two integer values m and n and to decide and print whether m is a multiple of n?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is 76.518 rounded to?

Rounded to the nearest whole number it is 77


How can I edit/enhance my photos?

You can decide whether the pictures you have taken are bad or not. There are multiple programs you can use to enhance your pictures and photoshop is the most reccommended.


A sales force manager needs to have information in order to decide whether to create a custom motivation program or purchase one offered by a consulting firm. What are the dilemmas the manager faces?

A sales force manager needs to have information in order to decide whether to create a custom motivation program or purchase one offered by a consulting frim. what are the dilemmas the manager faces in selecting either of these alternatives?


What is the whole number value of 0.06?

Depending on the specific requirements of a particular problem, you must decide whether you want to round down (to 0), round up (to 1), or round to the nearest integer (to 0).


How might you decide whether a given substance is mineral?

how might you decide whether a given substance is a mineral


How might decide whether a given substance is a mineral?

how might you decide whether a given substance is a mineral


How might you decide whether given substance is mineral?

how might you decide whether a given substance is a mineral


How does knowing the absolute values of an integer help you when multiplying and dividing?

You do the multiplication or division using the absolute value - without worrying about the sign. Then, when you have got the answer, you apply the rules for signs to decide whether your answer should be positive or negative.


How do you use decide in a sentence?

I can't decide whether or not to go to bed.


How do you decide which integer type to use in c language?

By the range of values you wish to represent.


How do you create a problem that uses probability?

To decide whether or not to take an umbrella as you go out, you need to know the probability that it will rain.To decide whether or not to take an umbrella as you go out, you need to know the probability that it will rain.To decide whether or not to take an umbrella as you go out, you need to know the probability that it will rain.To decide whether or not to take an umbrella as you go out, you need to know the probability that it will rain.


Which identifitcation tests would help you decide whether the nuggets are gold?

Density and fracture would help you decide whether the nuggets gold