English

What is the difference between / and % operator? - Computer Applications

Advertisements
Advertisements

Question

What is the difference between / and % operator? 

Distinguish Between

Solution

S. No. / %
1. Division (/) operator Modulus (%) operator
2. Returns the quotient of division operations. Returns the remaining from the division operation.
3. Example: 
int c = 26;
b = c / 5 returns 5 (quotient) 
Example: 
int c = 26; 
b = c / 5 returns 1 (remainder) 
shaalaa.com
  Is there an error in this question or solution?
Chapter 1.04: Operators in Java - EXERCISES [Page 44]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 1.04 Operators in Java
EXERCISES | Q V. 5. (a) | Page 44
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×