sofiadaniela0000
sofiadaniela0000 sofiadaniela0000
  • 17-11-2020
  • Computers and Technology
contestada

JAVA
Use a for loop to print the even numbers between 1 and 50, including the first even number, and the number 50. Print each number on a new line.

Respuesta :

Cytokine
Cytokine Cytokine
  • 17-11-2020

public class JavaApplication65 {

   

   public static void main(String[] args) {

       for (int i = 1; i <= 50; i++){

           if (i % 2 == 0){

               System.out.println(i);

           }

       }

   }

   

}

I hope this helps!

Answer Link

Otras preguntas

You are running a DHCP server on your Linux system which is attached to a public network and a private network. What must you remember to do before clients on t
What is the significance of the Zapotec glyphs?A) It is composed entirely of ideogramsB) All of the aboveC) It represents sounds from letters of the αbetD) It m
Consider the 2³ design in two blocks of four runs with AB as the independent effect chosen to be confounded with blocks. Generate the design?
What is not considered to be among the major risks of outsourcing value chain activities presently performed in-house? a. A company may farm out the wrong types
How can the resonance energy of benzene be determined?
What quantity in moles of NaOH are there in 225.0mL of 2.50M NaOH
If a government sells import licenses on a competitive basis to the highest bidders, then its method of license allocation is a (an) _________ a. auction. b. fi
Latin American dances are highly influenced by the African drumming traditions. Select an option: 1) True 2) False
logarithmic for 8_v=n
What is photosynthesis