Given a large number we sometimes need to extract


Given a large number we sometimes need to extract individual digits or sequences of digits from it. For example, given a four-digit year (2010) we may need to extract just the two-digit year or the century. The mathematical operators modulus (Java: %) and division (Java: integer division /) help us with this. Using the operators % and / write the Java expression that will extract the following:

From 2010 extract the 10 and the 20

From 98765432 extract the middle three digits (765)

From 153 extract each individual digit (1, 5, 3)

Write your solution in a simple text file.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Given a large number we sometimes need to extract
Reference No:- TGS01249135

Now Priced at $20 (50% Discount)

Recommended (93%)

Rated (4.5/5)