Friday, September 24, 2010

Factors

this pgm ll let u to find the factors of a given number......



import java.util.Scanner;
public class yp{public static void main(String args[]){
int i,j,n;
Scanner in=new Scanner(System.in);
i=in.nextInt();
for(j=1;j{
if(i%j==0)
{
System.out.println(j);
}
}
}
}

No comments:

Post a Comment