Product of first n natural numbers-algorithm, Basic Computer Science

Product of first n natural numbers - Algorithm

Working Procedure :

1. Take n = 8
2. Take I = 1
3. Take PROD = 1
4. Compute PROD = PROD * 1
5. add 1 to 1
6. If I≤ n, complete the steps from 4 to 6
7. Else, Print the value of PROD
8. Stop

2271_flow chart2.png

Posted Date: 8/29/2012 4:24:30 AM | Location : United States







Related Discussions:- Product of first n natural numbers-algorithm, Assignment Help, Ask Question on Product of first n natural numbers-algorithm, Get Answer, Expert's Help, Product of first n natural numbers-algorithm Discussions

Write discussion on Product of first n natural numbers-algorithm
Your posts are moderated
Related Questions
Central Processing Unit (CPU): The CPU is the physical device that controls computer operations. It is considered as the 'brain' of the computer system. The CPU comprises thre

write algotithm and flow chart for largest of 3 numbers

QUESTION (a) Using diagrams, describe the 2-tier and 3-tier architectures. (b) What is a middleware? Explain the functions of a middleware. Give two examples of middleware.

Question 1 Briefly explain Registers Question 2 What are complier and interpreter? Question 3 Explain the process of installing Windows XP Question 4 Wr

QUESTION (i) Define each of the following terms: a) Interlibrary lending b) Manuscript c) Papyrus d) Community profile e) Mauritiana (ii) Explain with example


Assume that s is a string variable  that is supposed to contain a value to be converted to integer. Write a fragment of code that converts the value to integer variable  and displ

QUESTION (a) Give the two conditions required by a binary tree of depth d to be an almost complete binary tree. (b) Determine what the following recursive C function compute

Write an Assembly program that reads an integer (-32,768 through 32,767) in decimal and prints its equivalent in binary. The output must show all 16 bits. And you must use a loop

The instructions of the logic functions are: and not, or and xor. These act on the bits of their operators. To make sure the result of the operations we revolve to the cmp and test