Computer Science, asked by shizuka123, 1 month ago

What is the difference between ‘/’ and ‘%’ operators?​

Answers

Answered by ushasingh9191
3

Both / and % are two different operators used in Java. These operators are mathematical operators and both have different uses. / Only perform the division operation in mathematics and returns results as the quotient, while % is known as modulus.

/ divides and returns the answer.

Example

8/2 = 4

% divides and returns the remainder.

Example:

13 % 2 = 6 and reminder is 1.

 \\  \\  \\  \\

♥╣ʜᴏᴘᴇ ᴛʜᴇ ᴀʙᴏᴠᴇ ᴀɴsᴡᴇʀ ʜᴇʟᴘs ᴜʜʜ..╠♥

♥╣ᴘʟss ᴍᴀʀᴋ ᴍʏ ᴀɴsᴡᴇʀ ᴀs ʙʀᴀɪɴʟɪᴇsᴛ..╠♥

Similar questions