generate functionThu, 02 Mar 2023

A natural number n is entered. Print the first natural number found (that is, iterate over numbers starting from 1) whose square is greater than n. Implement the program using a while loop.

def square_greater(n): i = 1 while i * i <= n: i += 1 print (i) square_greater(20)

Questions about programming?Chat with your personal AI assistant