Question: Write a Java program that calculates the number of integers in a range from 1 to some user-specified upper bound that are divisible by 4,
Write a Java program that calculates the number of integers in a range from 1 to some user-specified upper bound that are divisible by 4, the sum of those integers, and the number and sum of those integers not divisible by 4. A sample output may look like this:
The following results are based on the sample size: 1 - 4.0 There are 1 numbers divisible by 4. The sum of the numbers divisible by 4 is 4 There are 3 numbers not divisible by 4. The sum of the numbers not divisible by 4 is 6
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
