{"id":7151,"date":"2021-09-30T10:30:46","date_gmt":"2021-09-30T05:00:46","guid":{"rendered":"https:\/\/python-programs.com\/?p=7151"},"modified":"2021-11-22T18:35:33","modified_gmt":"2021-11-22T13:05:33","slug":"python-program-to-find-the-factors-of-a-number","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-find-the-factors-of-a-number\/","title":{"rendered":"Python Program to Find the Factors of a Number | C++ Program to Find Factors"},"content":{"rendered":"

Beginners and experienced programmers can rely on these Best Java Programs Examples<\/a> and code various basic and complex logics in the Java programming language with ease.<\/p>\n

Factors of a number:<\/strong><\/p>\n

When two whole numbers are multiplied, the result is a product. The factors of the product are the numbers we multiply.<\/p>\n

In mathematics, a factor is a number or algebraic expression that equally divides another number or expression, leaving no remainder.<\/p>\n

The prime number is defined as a number that has only two factors\u00a0one and itself. Composite numbers are those that contain more than two variables.<\/p>\n

Given a number the task is to print the factors of the given number.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

given_number=360<\/pre>\n

Output:<\/strong><\/p>\n

printing the factors of given number\r\n1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n8\r\n9\r\n10\r\n12\r\n15\r\n18\r\n20\r\n24\r\n30\r\n36\r\n40\r\n45\r\n60\r\n72\r\n90\r\n120\r\n180\r\n360<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

given_number=10<\/pre>\n

Output:<\/strong><\/p>\n

printing the factors of given number\r\n1\r\n2\r\n5\r\n10<\/pre>\n

Program to Find the Factors of a Number<\/h2>\n

Below are the ways to find the factors of a number:<\/p>\n