Go to Top

Friday, 4 November 2011

To print all the factors of a number

Question 67 : Write a program in Java to print all the factors of a number.

Java Program :

import java.io.*;
class factors
 static void main()throws IOException
     BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
     int a,i;
     System.out.print("Enter the number : ");
     System.out.print("The factors are : ");

1 comment:

  1. can u pls write it using import java.util.*;
    pls i need it