Scala Int %(x: Int) method with example
The %(x: Int) method is utilized to return the remainder when the specified first int value is divided by the second int value.
Method Definition: (First_Int_Value).%(Second_Int_Value)
Return Type: It returns remainder when the specified first int value is divided by the second int value.
Example #1:
// Scala program of Int %(x: Int) // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Applying Int %(x: Int) function val result = (100).%(50) // Displays output println(result) } } |
chevron_right
filter_none
Output:
0
Example #2:
// Scala program of Int %(x: Int) // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Applying Int %(x: Int) function val result = (100).%(40) // Displays output println(result) } } |
chevron_right
filter_none
Output:
20
Recommended Posts:
- Scala Int !=(x: Int) method with example
- Scala Set min() method with example
- Scala Set contains() method with example
- Scala Int +(x: Int) method with example
- Scala Int &(x: Int) method with example
- Scala Set ++() method with example
- Scala Map last() method with example
- Scala Set &() method with example
- Scala Int abs() method with example
- Scala Int <=(x: Int) method with example
- Scala Map max() method with example
- Scala Int <(x: Int) method with example
- Scala Int *(x: Int) method with example
- Scala Set &~() method with example
- Scala Map min() method with example
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

