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
horsena [70]
3 years ago
8

It is good programming style to always use a for loop when the number of times to repeat the action is known. The following code

uses a while loop that mimics what a for loop should do. Rewrite it using a for loop that accomplishes exactly the same thing.
myprod = 1;
i = 1;
while i <= 4
num = input('Enter a number: ');
myprod = myprod ⁎ num;
i = i + 1;
end
Mathematics
1 answer:
Paraphin [41]3 years ago
7 0

myprod = 1

num = input("Enter a number: ")

for i in range(1, 5):

myprod *= num

You might be interested in
What is the 11th term of the arithmetic sequence with the rule a, = - 2 +6(n-1)?
Arada [10]

Step-by-step explanation:

The 11th term means there are 10 gaps in between the first term and the 11th term. Each gap has a difference of +4, so the 11th term would be given by 10 * 4 + 1 = 41.

4 0
3 years ago
Which fraction is in its lowest terms?<br><br> 4/5<br> 3/9<br> 4/6<br> 2/8
artcher [175]

Answer:

4/5

Step-by-step explanation:

  1. 4/5 cannot be simplified
  2. 3/9 = 1/3
  3. 4/6 = 2/3
  4. 2/8= 1/4
6 0
3 years ago
23 times 58 divied by 23 minus 8 plus 5 times 1 dived by 7
cricket20 [7]

Answer:

355/7

or

50.7...

6 0
3 years ago
Read 2 more answers
Help with math plz! Giving brainlist
Kisachek [45]
First one, 

You add -7 to the pattern. 

5, -2, -9, -16.
50 times is going to be -350. But it starts at 5, so you add 5 to -350... so it should be -345?

second if the top is 7.1 and the bottom is 3.9. The average is (7.1+3.9)/2.
11/2 = 5.5

Add 10 to each number in the pattern.
-7, 3, 13, 23. 
110 times should be 1100, but it starts at -7, so you add -7 to 1100. 1093. :)
7 0
3 years ago
A pancake recipe calls for 8 eggs and 40 cups of flour. How many cups of flour would you need for a single egg
olga nikolaevna [1]

Answer:

gbsfghaftgjmbedhejukyfy;p

Step-by-step explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • The following are examples of slant rhymes: may/day, stone/alone, and me/sea.
    6·2 answers
  • See pic attached. Can't figure out this one.
    12·1 answer
  • It is possible to have a concavity change without the point of inflection (true/false)​
    13·1 answer
  • Complete A,B for 2,3 for 12 points
    9·2 answers
  • February 29th is on Sunday. on what day will the next February 29th be?​
    6·1 answer
  • Group B &amp; C
    8·1 answer
  • May thejskksktksmskaksjfksksksnfnf
    15·1 answer
  • 4
    15·1 answer
  • There are 30 total cards. 10 are yellow. What are the chances that you pull 2 yellow cards.
    13·1 answer
  • An employee at a fireworks company is designing a rocket. The rocket will consist of a cardboard circular cylinder with a height
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!