Ask Question

Write a while loop that asks the user to enter two numbers. the numbers should be added and the sum displayed the loop should ask the user if he or she wishes to perform the operation again. if so, the loop should repeat, otherwise it should terminate.

+1
Answers (1)
  1. 19 October, 05:18
    0
    Int repeat = 'y'

    while repeat = = 'y':

    num1 = int (input ("Enter first number: "))

    num2 = int (input ("Enter second number: "))

    sum = num1+num2

    print ("The sum is : "+str (sum))

    repeat = int (input ("Try another? (y/n) "))
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write a while loop that asks the user to enter two numbers. the numbers should be added and the sum displayed the loop should ask the user ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers