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
India Languages,
3 days ago
English,
3 days ago
Social Sciences,
7 days ago
Chinese,
8 months ago
Math,
8 months ago