menu
bartleby
search
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

Question

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 

check_circleAnswer
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

Engineering

Computer Engineering

Other

Related Computer Engineering Q&A

Find answers to questions asked by student like you

Show more Q&A add
question_answer

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...

question_answer

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...

question_answer

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...

question_answer

Q: Use Eclipse for this program

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

question_answer

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...

question_answer

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...

question_answer

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...

question_answer

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 ...

question_answer

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?