• Modulo operator:  The modulo is defined as "the remainder of the two arguments ".
  • It is denoted by the symbol   "%".
  • When we divide any number with 0 i.e;    x%0 the result is zero division error.
  • We can use int, float, and double values also.
  • Those int, float, double may be either positive or negative.
x is the first argument and y is the second argument.

#1.write a python program using the modulo operator.

  1. x=10.0
  2. y=2.0
  3. print(x%y)
output: 0.0

#2.write a python program for a value divides with 0 using the modulo operator.
  1. x=10.0
  2. y=0
  3. print(x%y)
output: zero division error

Instance Of Java

We will help you in learning.Please leave your comments and suggestions in comment section. if you any doubts please use search box provided right side. Search there for answers thank you.
Newer Post
Older Post

No comments

Leave a Reply

Select Menu