Computer Science, asked by jeslinejeba, 19 days ago

write a algorithm to print sum of n numbers (n=5)​

Answers

Answered by AnannyaPatil06
0

Answer:

1. Take a variable sum=0 and count = 0

2. Take a value for n.

3. Do sum = sum+n and increase the value of count by one.

4. Is count<5? Then, go to '2'. Else, continue.

5. Display sum.

6. Exit.

If this helps then please mark it as the Brainliest!

Answered by sarakularonnie49
0

Explanation:

Step 1 : Start  Step 2 : Set i 1, S 0  Step 3 : Read a number and set to n  Step 4 : Computer i and n if i>n then go to step 7.  Step 5 : Set S <— S+ i Step 6 : i <— i+1 go to step 4  Step 7 : avg 4<— S/n  Step 8 : Print “Sum = S and average = avg”  Step 9 : Stop numbers.Read more on Sarthaks.com - https://www.sarthaks.com/1116056/write-an-algorithm-to-find-the-sum-of-n-natural-numbers-and-average

Similar questions