Computer Science, asked by arpeetamohanty, 4 months ago

Write a python programme to ask the user to input 5 positive integers. If the user enters a non-positive integer, exit the loop, telling that the user input an invalid entry. If user enters all 5 positive integers, print the sum of the integers and display "Well done!". using for loop​

Answers

Answered by gaganadithyareddy9
0

Answer:

Hey this is in python...

sum = 0

for i in range(5):

   num = int(input("Enter a number: ")

   if num<0:

       print("You have entered invalid input")

       break

   else:

       sum+=num

Similar questions