Write an application that inputs two integer numbers n1 and n2 from the user, th
ID: 3625616 • Letter: W
Question
Write an application that inputs two integer numbers n1 and n2 from the user, these two numbers represent a range. Develop the logic to prints all integers in this range that are divisible by 7 and 11 simultaneously. The following shows a sample output when the application is run with n1 = 1 and n2 = 500Enter the first integer n1 = 1
Enter the second integer n2 = 500
The following numbers are divisible by 7 and 11 simultaneously:
77
154
231
308
385
462
6 numbers are divisible by 7 and 11 within 0 to 600
Explanation / Answer
import java.util.Scanner; public class divisible { public static void main(String args[]) { Scanner input = new Scanner(System.in); System.out.print("Enter the first integer: "); int n1 = input.nextInt(); System.out.print("Enter the second integer: "); int n2 = input.nextInt(); int count = 0; for (int i = n1; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.