81.8k views
3 votes
What will be the output of the expression A % B // A if A=16 and B=15

1 Answer

1 vote

Answer:

A % B // A = 0

Step-by-step explanation:

Given

A = 16

B = 15

Required

Find A % B // A

The symbol, % (pronounced, modulo) is used to return the remainder after two integers are divided.

In this case;

A % B = 16 % 15

When 16 is divided by 15, the result is 1 and the remainder is 1.

In other words, 16 divide 15 = 1 remainder 1.

Now, we're left with (A%B)//A

=> 1//16

// means floor division.

If 1/16 = 0.0625

The floor division of 1 and 16 is 0

This is so because, it only returns the integer part of the division.

So, A % B // A = 0 when A = 16 and B is 15

User Organis
by
5.8k points