Ask a New Question

Asked by SURESH

The algorithm below finds the product of first 10 numbers .
4 years ago

Answers

oobleck
p=1
for i=1..10 {
p *= n[i]
}
This finds the product of the first 10 numbers in an array,
If you just mean the numbers 1-10, then change n[i] to just i
4 years ago

Related Questions

The following algorithm gives a correct answer: 488 + 65 5^1 5^1 3 What does “the algorithm” do in the context of social media? (1 point) How could the algorithm be used to solve a different problem Which of these is an algorithm? (1 point) Responses a love letter a love letter a poem... Which of these is an algorithm? a love letter a poem a pizza recipe a shopping list 1. What is an algorithm? 1 pt A type of computer hardware A programming language A set of... Using your algorithm, what will the bill be if the customer talks on the phone for 190 minutes and s...
Ask a New Question
Archives Contact Us Privacy Policy Terms of Use