Skip to main content

Factorization

  • Chapter
  • First Online:
Learn Java with Math
  • 1407 Accesses

Abstract

In elementary school math, we usually follow a procedure to find all factors for any given positive integer number. This process is called factorization, and it takes quite a lot of calculation depending on how big the integer number is. With the Java programming environment, let's create a simple program to do the same job for us. We'd like to write code to find all factors of any positive integer. When a user inputs "10," the program is supposed to output: 1, 2, 5, and 10. As the first step, we need to define the procedure and then implement it by Java code.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 16.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Ron Dai

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Dai, R. (2019). Factorization. In: Learn Java with Math. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-5209-3_22

Download citation

Publish with us

Policies and ethics