Computer Science, asked by theroka101, 19 days ago

Enter 10 number and find out the sum and average of the number​

Answers

Answered by satyam21461
0

Explanation:

The following steps are taken to make the program-

Declare the required variables.

use the while loop.

inside the loop, input the values and calculate the sum.

outside the loop, calculate the average.

finally, print the answer.

Program:

print("Enter 10 numbers")

i = 0 # to iterate the loop

s = 0 # intializing the value to 0 to calculate the sum

while i < 10:

n = int(input()) # taking input as integer

s = s + n # modifying the variable to calculate the sum after every input

i += 1 # incrementing the loop counter

avg = s / 10 # calculating the average of the values

print("The sum is = ",s)

print("The average is =",avg)

#answerwithquality

#BAL

Attachments:
Answered by gundekarsupriya9
0

Answer:

the average of 10 numbers

is

4.7

Similar questions