Java count

profilePmnguyen1989

  

Program 4: Nested Loops. Design (pseudocode) and write (source code) a program that asks the user for a number and counts from 1 to that number – listing out all numbers that could be factors for that number. It’s probably best just to look at the example below…

Sample Output

Enter a number to count up to: 10

====================

1 is divisible by 1

====================

2 is divisible by 1

2 is divisible by 2

====================

3 is divisible by 1

3 is divisible by 3

====================

4 is divisible by 1

4 is divisible by 2

4 is divisible by 4

====================

5 is divisible by 1

5 is divisible by 5

====================

6 is divisible by 1

6 is divisible by 2

6 is divisible by 3

6 is divisible by 6

====================

7 is divisible by 1

7 is divisible by 7

====================

8 is divisible by 1

8 is divisible by 2

8 is divisible by 4

8 is divisible by 8

====================

9 is divisible by 1

9 is divisible by 3

9 is divisible by 9

====================

10 is divisible by 1

10 is divisible by 2

10 is divisible by 5

10 is divisible by 10

    • 7 years ago
    • 5
    Answer(3)

    Purchase the answer to view it

    blurred-text
    NOT RATED

    Purchase the answer to view it

    blurred-text
    NOT RATED
    • attachment
      Count.java

    Purchase the answer to view it

    blurred-text
    NOT RATED
    • attachment
      java-count.zip
    • attachment
      MultipleCount.java
    • attachment
      pseudocode.txt
    • attachment
      output.png
    • attachment
      output.txt