Questions LLC
Login
or
Sign Up
Ask a New Question
Programming
Loop Structures
Number Generation
writing a program using loop structure, need the equation to produce all even numbers from 2-100 to print out each time I go through the loop
1 answer
loop {
for (i=2;i<=100;i+=2) {print i}
}
You can
ask a new question
or
answer this question
.
Similar Questions
What structure should be used to create an infinite loop in a block-based program?
(1 point) Responses if statement if statement
Top answer:
forever loop
Read more.
What structure should be used to create an infinite loop in a block-based program?
(1 point) A. if statement B. for loop C. while
Top answer:
C. while loop
Read more.
What structure should be used to create an infinite loop in a block-based program?
(1 point) if statement O for loop while loop O
Top answer:
while loop
Read more.
What structure should be used to create an infinite loop in a block-based program?
A. If statement B. For loop C. While loop D.
Top answer:
D. Forever loop
Read more.
how do i write java loop program where the user enters 10 random numbers. the program then collects the prime numbers from that
Top answer:
I assume you can write a loop and get input. sum=0 start loop... get input n if n==13 break; if
Read more.
Which structure is best to use when the user has four chances to enter the correct information into a program?
an if statement a
Top answer:
a for loop
Read more.
Sonja is writing a program to compare two numbers and print the larger number. Which of these should be used?
(1 point) Responses
Top answer:
if and else statements should be used to compare two numbers and print the larger number.
Read more.
Say you want to write a program to have Karel put down 300 tennis balls. Which control structure would you use?
If statement
Top answer:
A For loop would be the most appropriate control structure to use in this scenario. A For loop
Read more.
Malik wants to create a program that will repeat Spanish vocabulary words five times. What kind of loop should be used to do
Top answer:
for loop
Read more.
Write a program that plays a simple dice game between the computer and the user. It uses an unusual dice that has 12 sides, with
Top answer:
Sure, I can help you with that! Here's a Python program that plays the dice game as described:
Read more.
Related Questions
1. What process locates a specific set of characters in a data set?
a. data collection b. data analysis c. pattern matching d.
If the number of times that I leave for a peach will be determined by whether the user inputs the correct answer to a trivia
Jasmine is creating a game where the same sequence will repeat four times what kind of loop should be used for this feature of
Malik wants to create a program that will repeat Spanish vocabulary words five times. What kind of loop should be used to do
Which structure should you use if you don’t know in advance how many times a loop should execute?
(1 point) Responses a for
Sonja is writing a program to compare two numbers and print the larger number. Which of these should be used?
(1 point) while
1)Your program will get numbers (int) from the user. Do this in a while loop so that you keep getting more numbers.
If the number
4.
Marta is creating a program that will guide the user through a series of physical exercises. She wants the program to coach
Marta is creating a program that will guide the user through a series of physical exercises. She wants the program to coach the
Marta is creating a program that will guide the user through a series of physical exercises. She wants the program to coach the