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

What Does 'Dog Eat Dog' Mean?
By controlling trade, three great kingdoms developed in West Africa. These were the kingdoms of Ghana, Mali, and ______. Fill in the blank.
What was the relationship between the temperance and suffrage movement
what does 'chop and change' mean?
1 . A farmer moves along the boundary of his rectangular field of side 10m x 20m . farmer covers 1m in 1sec . what will be the magnitude of displacement at the
An elevator is used to either raise or lower sacks of potatoes. In the diagram, a sack of potatoes of mass 10 kg is resting on a scale that is resting on the fl
Divide.(10a^4-5a^3) / 5a
What Does 'Behind Bars' Mean?
what are the dog days of summer?
Calculate the de Broglie wavelength of an electron traveling at 3.0 × 107 m/s (me = 9.1 × 10-31 kg).