bhattaraisunita20
bhattaraisunita20 bhattaraisunita20
  • 15-05-2021
  • Computers and Technology
contestada

WAP TO FIND THE PRODUCT OF 10 NATURAL NUMBERS​

Respuesta :

phenom786
phenom786 phenom786
  • 15-05-2021

Answer:

since you didn't specify which language to write it in, this is for python

Explanation:

def sum(N):

s = 0

for i in range(N + 1):

s += i

return s

def product(N):

p = 1

for i in range(1, N+1):

p *= i

return p

for i in (500, 9, -2):

print(i)

print(sum(i))

print(product(i))

Answer Link

Otras preguntas

Which best describes the animals in "Rum Tum Tugger" and "Lone Dog"? A. meek B. loving C. independent D. dirty
using a number line, what is 235+123
Each one of the following sentences contains a clause. In which sentence is the clause used as an adverb? a. All of the delegates who have actual opinions shou
If a mass of gas is confined in a closed container with a movable piston above the gas and a small downward force is applied to the piston, the volume of the ga
State the universal law of gravitation
How can I solve for d with the formula is C=rd
One factor that keeps the Philippines culturally united is _____. Roman Catholicism a strong economy local dialects a long history of independence
The Romantic movement started as a rejection of what? a. Changes brought about by capitalism b. Changes brought by Catholicism c. Changes brought about by na
A bag contains 3 blue marbles, 7 red marbles, and 5 yellow marbles. If Joe picks 1 marble from the bag at random, what is the probability that it will be blue?
what is the median numbers 4,8,10,5,9