Computer Science, asked by mashahzad2010, 7 days ago

5. Input a number and display its factors.plz also draw flow chart​

Answers

Answered by SP85
0

Java program

class Test

{

static void printDivisors(int n)

{

for (int i=1;i<=n;i++)

if (n%i==0)

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

}

public static void main(String args[])

{

System.out.println("The divisors of 100 are: ");

printDivisors(100);

}

}

Attachments:
Similar questions