Ask Question
2 February, 22:35

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.

+3
Answers (1)
  1. 3 February, 00:50
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers