Computer Science, asked by avisha43, 11 months ago

write an algorithm to calculate the multiplication of five numbers

plz write step by step​

Answers

Answered by ayeshashakil07
6

Answer:

Assume the five number is 1 to 5 i.e., 1 2 3 4 5

step 1 : set count =1

step 2: if count <=5                          

                    continue

            else

                    stop

step 3: result = result * count

step 4: Print result

step 5: count = count +1,  Go to Step 2.

Explanation:

In step 2 condition should be less than equal to 5, because it's mention in the question multiplication of 5 number.

so the loop will run 5 times.

if count will more than 5 then the loop will stop.

step 3 In this multiplication of number will store every time and multiply with the next number and store in the same variable again.

step 5 In this count will increase and again go to step 2 to check whether the condition is true or false.

If you feel any difficulty in understanding this algorithm then let me know.

Thank you.

Answered by ak134433
0

Answer:

Program to multiply two numbers in C:

h> void main(){ int one, two, multiply; printf("Enter first number - "); scanf("%d",&one); printf("Enter second number - "); scanf("%d",&two); multiply = one * two; printf("The multiplication of numbers %d and %d is %d",one,two,multiply); getch(); } //End of the program

Similar questions