1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
motikmotik
3 years ago
11

Write an algorithm to print even numbers from 1 to 100

Computers and Technology
1 answer:
maxonik [38]3 years ago
8 0

Answer:

// Java solution

for ( int i = 0; i < 101; i++)

{

 if ( i % 2 == 0)

 {

     System.out.println( i + " ");

 }

}

Using modulus, whatever number we are currently on in our loop is evaluated to see if it is even. Any number divided by 2 that is even will not have a remainder, hence ==0. So we just print the numbers that satisfy that condition and we have all evens.

You might be interested in
What are the TWO methods of copying and pasting on the AutoCAD Clipboard function?
padilas [110]

A) copy and copy basepoint  


8 0
3 years ago
The Internet is not a good place to connect with people when looking for a job.
djyliett [7]
This is kind of in opinion , i think it is true as people could be on the internet to kidnap or hurt others. It depends on what you think
8 0
4 years ago
Harvey is creating a presentation for his school project. He wants to have the same look on all the slides of his presentation.
Dimas [21]
<h2>Answer:</h2>

<u>Theme option in the design tab</u>

<h2>Explanation:</h2>

After opening his slides in power point he must click on the Design Tab and then selecting a theme from various options that come in front of him. He can select any theme and then click apply to all. This will allow him to apply the same theme over all his slides of presentation.

6 0
4 years ago
Read 2 more answers
How to write greater than or equal to in excel if function
natali 33 [55]

Answer:>=

Explanation:3>=4

I

5 0
3 years ago
Which tag you will use to explain a set of in an HTML document?
Ahat [919]

Answer:

<p> </p>

Explanation:

3 0
4 years ago
Other questions:
  • Find every number from 1 to n (inclusive) that is a palindrome which starts with the digit 3. Do not user a helper function.
    10·1 answer
  • to print a range of cells in the active worksheet click blank in the settings area in the print gallery
    9·2 answers
  • Which of the following has the honor of the first robot-human handshake in space?
    10·1 answer
  • Colin Mackay Inc., a software company with its head office in Amsterdam, has employees across three continents. Certain project
    11·1 answer
  • What type of computer is used in ATM?
    11·2 answers
  • Lyla is writing a program that uses a recursive method. Why might she want to use a recursive helper method?
    8·1 answer
  • c) If you are at foreign country visit, which banking card would you prefer to keep with you during visit (Debit Card or Credit
    10·1 answer
  • How easily can teachers see browsing history on chromebook]
    9·1 answer
  • ((Excel)) please help, 100 points, and brain crown thingy, not only that, i will make several of these so you can get several hu
    12·1 answer
  • the implications your organization of providing email facilities to individuals in the workplace in terms of security and virus
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!