Write Program in Python to Find Sum and Average of Natural Number Using While Loop Example : Code Program n = 1 sum = 0 avg = 0.0 while n <= 10: print(n) sum += n n = n+ 1 print("The Sum is :", sum) avg = sum/10 print("The Average is :", avg) Output
Post a Comment