English

If int a = 27, b = 4, c = O; then c = a%b; results in 3. - Computer Applications

Advertisements
Advertisements

Question

If int a = 27, b = 4, c = O; then c = a%b; results in 3.

Options

  • True 

  • False

MCQ
True or False

Solution

This statement is True.

Explanation:

The % operator is the modulus (remainder) operator, producing the remainder of a division by b.

  1. When 27 is divided by 4, the quotient is 6, with a leftover of 3.
  2. So, c = 27% 4 gives c = 3. 
shaalaa.com
  Is there an error in this question or solution?
Chapter 1.04: Operators in Java - EXERCISES [Page 43]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 1.04 Operators in Java
EXERCISES | Q II. 6. | Page 43
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×