Write a Java program that reads two positive integers num1 and num2 (assume num1


Java language


Write a Java program that reads two positive integers num1 and num2 (assume num1 < num2). Then, the program<br>will display all perfect numbers between num1 and num2. A positive integer is called a perfect number if it is equal to<br>the sum of all of its positive divisors, excluding itself. For example, 6 is the first perfect number because 6 = 3 +2 + 1.<br>The next is 28 = 14 + 7+4 +2 + 1. Hint: use modulus (%) to find the divisor of a number.<br>Sample Input/Output<br>Input the 2 numbers: 6 1001<br>Perfect Numbers are:<br>6.<br>28<br>496<br>

Extracted text: Write a Java program that reads two positive integers num1 and num2 (assume num1 < num2).="" then,="" the="" program="" will="" display="" all="" perfect="" numbers="" between="" num1="" and="" num2.="" a="" positive="" integer="" is="" called="" a="" perfect="" number="" if="" it="" is="" equal="" to="" the="" sum="" of="" all="" of="" its="" positive="" divisors,="" excluding="" itself.="" for="" example,="" 6="" is="" the="" first="" perfect="" number="" because="" 6="3" +2="" +="" 1.="" the="" next="" is="" 28="14" +="" 7+4="" +2="" +="" 1.="" hint:="" use="" modulus="" (%)="" to="" find="" the="" divisor="" of="" a="" number.="" sample="" input/output="" input="" the="" 2="" numbers:="" 6="" 1001="" perfect="" numbers="" are:="" 6.="" 28="">

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here