close search
Hit Return to see all results

Write a program called ListEvenNumbers wich prints the even numbers from 20 to 30 (including 30). and that prints the below (there is a single spacebetween each number)Printing even numbers between 20 and 30 (including 30).20 21 22 23 24 25 26 27 28 29 30


Write a program called ListEvenNumbers wich prints the even numbers from 20 to 30 (including 30). and that prints the below (there is a single space
between each number)

Printing even numbers between 20 and 30 (including 30).

20 21 22 23 24 25 26 27 28 29 30 

Step 1

As there is no programming language mentioned, we are doing this program in java to print even numbers between 20 to 30 (including 30).

Step 2

The following java program will print even numbers between 20 to 30(including 30)

 public class ListEvenNumbers {

                public static void main(String[] args) {

                                System.out.println("Printing Even numbers between 20 and 30 (including 30)" );

                                for(int i=22; i <= 30; i++){

                                                // if the number is divisible by 2 then it is even


Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Our solutions are written by experts, many with advanced degrees, and available 24/7

See Solution
Tagged in


Computer Engineering


Related Computer Engineering Q&A

Find answers to questions asked by student like you

Show more Q&A add

Q: WRITE A JAVA PROGRAM that perform the Insertion Sort, Bubble Sort, Merge Sort, and Quick Sort algori...

A: Program Instructions:Create four methods named insertionSort(), bubblesort(), mergesort() and quicks...


Q: Show the output of the following code: Explain brieflyint a = 6;int b = a++;System.out.println(a);Sy...

A: The Output of the given code is shown below along with the code. To run the given code, it is import...


Q: Write a class, AgeMessages , which does the following:a. Ask the user to enter age using a Scannerb....

A: The algorithm for the program would be as below:Declare one float variable for accepting user inputP...


Q: Use Eclipse for this program

A:  Step 1: Import required package.Step 2: Define “AnalyzeNumbers” class.Step 3: Define main function....


Q: Assume that a firm has already implemented a KMS system, as a manager, how do you ensure that learni...

A: The given case study describes the internal knowledge assets of the organization and details about t...


Q: Consider different risk mitigation strategies for system development programs. What type of strategy...

A: Risk mitigation: Let’s start to discuss about the risk . Risk is a possibility of loss which occurre...


Q: Reliability and safety are related but distinct dependability attributes. Describe two important dis...

A: Reliability: It refers to “quality changing over time “ means reliability always varies over time, i...


Q: Which element is required in a web application to operate the Server-Sent Events? a. c. eventsource...

A: Correct answer:The correct option is “c”.Explanation:“&lt;eventsource&gt;” is the element used in a ...


Q: What is the CPU time if the number of instructions executed by the program is 500 cycles per instruc...

A: CPU time:The formula for computing the CPU time is provided below:

Sorry about that. What wasn’t helpful?