Home > Back-end >  How can I check if a number is a multiple of another number in dart?
How can I check if a number is a multiple of another number in dart?

Time:02-26

How can I check if a number is a multiple of another number in dart? A whole multiple that is

CodePudding user response:

The modulo operator can help you on this. If your remainder is 0 then it is a multiple Example

if (144 % 12 == 0){
print('Multiple');

}

  •  Tags:  
  • dart
  • Related