answersLogoWhite

0

import java.io.*;

class PrimeFactors

{

private boolean prime(int a)

{

boolean b=true;

for(int i=2;i<=(a/2);i++)

{

if(a%i==0)

b=false;

}

return b;

}

protected static void main()throws IOException

{

BufferedReader in=new BufferedReader(new InputStreamReader(System.in));

System.out.print("Enter the Number: ");

int a=Integer.parseInt(in.readLine());

PrimeFactors o=new PrimeFactors();

System.out.println("Prime Factors of "+a+" are::");

for(int i=1;i<=(a/2);i++)

{

if(a%i==0)

{

boolean b=o.prime(i);

if(b==true)

System.out.print(i+" ");

}

}

}}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How do you write a number as a product of its prime factors?

write the number 14as a product of prime factor?


How do write 525 as a product of prime factors?

write the prime factorization of the number. simple as that.


What does 'products of its primes' mean?

To write a composite whole number as the product of its prime factors is to write its prime factorization.


What is it called when you write a number as a product of its factors?

the prime factorization


Is it true or false prime factorization renames a composite number as the product of prime factors?

True(Prime factorization is to write a composite number as a product of its prime factors).


What is the largest prime no that is stored in 8 bit pattern?

Write your own prime number program and find out.


Write the number 256 as a product of prime factors.?

256 = 28


Write each number as a product of its prime factors 87?

To write 87 as a product of its prime factors, we first divide it by the smallest prime number, which is 3. This gives us 87 = 3 * 29. Since 29 is a prime number itself, the prime factorization of 87 is 3 * 29.


How can I write a program to display prime numbers from 1 to 100?

Write a function that implements an algorithm that checks to see if a particular integer is prime (returning a boolean). Write a program that uses that function on each number from 1 to 100, and if true, displays that number.


How do you write the number 99 as a product of prime factors?

99 as a product of its prime factors is: 3*3*11 or 32*11


How do i write the number 185 as a product of prime factors?

5 times 37


How do you write 530 as a prime number?

2 5 53 are the factors of 530