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

A printer ink cartridge that can print 550 pages has already printed 127 pages. Which solution represents the correct equation and answer to the question, "How
Need help on 9 and 10 and that’s all I need
How were women colonists affected when New Netherland became New York?
The most common form of political participation in the United States is A) belonging to a political party. B) working on a political campaign. C) voting in pr
How did the battles fought at Vienna affect the Ottoman empire?
1,280 Cal into kilojoules
processes and packages proteins and lipids in the cell
The nurse is preparing a staff education inservice about specific safety measures that reduce patient medication errors. which measure improves safety for patie
Graph the line with slope -3 passing through the point (5,0)
Can you help me with 1 & 3?