:::: MENU ::::
  • Suitable for all screen sizes

  • Easy to Customize

  • Customizable fonts.

Saturday, December 19, 2015


Factors of a Numbers:

import java.util.*;
public class Factors
{
  public static void main()
  {
      int n,i;
      Scanner sc=new Scanner(System.in);
      System.out.println("Enter the Number");
      n=sc.nextInt();
      for(i=1;i<=n;i++)
      {
          if(n%i==0)
          {
            System.out.println(i);
          }
      }
  }
}

Thank you and make sure to like and comment.

0 comments:

Post a Comment

A call-to-action text Contact us