write a program to calaculate the sum of 10 numbers
Answers
Answered by
0
Answer:
By using small basic
Answered by
0
Python program :
Explanation:
Sum2=0.00# Variable which holds the sum value.
for y in range(10):#For loop which runs from 1 to 10.
number1=float(input("Enter the number : "))#Take the user input for 10 value.
Sum2=Sum2+number1#Add the value.
print("The Sum of ten number is : ",Sum2)#Print the sum.
Output :
- If the user gives the input as "1,1,1,1,1,1,1,1,1,1,1", then the output is 10.
- If the user gives the input as "1,1,1,1,1,1,1,1,1,1,3", then the output is 12.
Code Explanation:
- The above code is in python language, which takes the 10 value and prints the sum value.
- The program has a for loop which runs at 10 times and takes the 10 value and adds it to the sum variable.
- Then the value of a sum2 variable will be printed with the help of print function.
Learn More :
- Python : https://brainly.in/question/14689905
Similar questions