193k views
14 votes
What will be the output of the following:

i) 10%2 ii)10**2​

1 Answer

8 votes

Answer:

  • The output of 10%2 is 0
  • The output of 10**2 is 100

Step-by-step explanation:

We will see the output one by one.

i) 10%2

The statement consists of modulus operator also called as remainder operator. The remainder operator gives the remainder when the first operand is divided by the second operand. The remainder operator only works on integers.

So the output of the statement will be: 0

ii)10**2​

The double asterisk is used for exponent. The second operand is the power and the first operand is the base.

So the output will be: 10**2 = 10^2 = 100

Hence,

  • The output of 10%2 is 0
  • The output of 10**2 is 100
User JC Guidicelli
by
4.5k points