Ask Question
18 August, 17:52

Assuming the user enters integers, how many times will the following program print hi x = int (input ()) y = int (input ()) if x > 0 or y > 0: print ("hi") if x < = 0 and y < = 0: print ("hi")

+1
Answers (1)
  1. 18 August, 17:59
    0
    It prints "hi" only one time.

    Explanation:

    It will print the result depending on the if statements. If you look at the if statements, you will see that no matter you enter it is going to be either true for the first if statement or for the second if statement.

    Let's say you entered 1 for x and 0 for y, first if statement will print hi, but the second one will not print because x is not smaller or greater than 0.

    Let's say you entered 0 for x and 6 for y, second if statement will print hi, but the first one will not print because x is not greater than 0.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Assuming the user enters integers, how many times will the following program print hi x = int (input ()) y = int (input ()) if x > 0 or y > ...” 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