Dart Programming - remainder Method


Advertisements

It returns the truncated remainder after dividing the two numbers.

Syntax

Number.remainder(x)

Parameter

  • x − represents a divisor

Return Value

Returns the remainder of a division.

Example

void main() { 
   var a = 10; 
   var b = 17; 
   
   print(a.remainder(2)); 
   print(b.remainder(2)); 
}

It will produce the following output −.

0 
1
dart_programming_numbers.htm
Advertisements