5. Input a number and display its factors.plz also draw flow chart
Answers
Answered by
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
Math,
20 days ago
Math,
20 days ago
Social Sciences,
1 month ago
Chinese,
9 months ago
Math,
9 months ago