Ask Question
26 May, 04:00

Write a program whose input is two integers. Output the first integer and subsequent increments of 10 as long as the value is less than or equal to the second integer.

+1
Answers (1)
  1. 26 May, 06:29
    0
    import java. util. Scanner;

    public class TestClock {

    public static void main (String[] args) {

    Scanner in = new Scanner (System. in);

    System. out. println ("Enter two integer numbers");

    int num1 = in. nextInt ();

    int num2 = in. nextInt ();

    int newSum=num1+10;

    System. out. println ("The first number is "+num1);

    do{

    System. out. println (newSum);

    newSum + =10;

    }while (newSum <=num2);

    }

    }

    Explanation:

    Using Java Programming language

    Prompt user for the two inputs and save them as num1 and num2 (Using the scanner class) Create a new Variable newSum = num1+10 Create a do ... while loop to continually print the value of newSum, and increment it by 10 while it is less or equal to num2
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a program whose input is two integers. Output the first integer and subsequent increments of 10 as long as the value is less than or ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers