Check whether the given loop is finite or infinite. If infinite, do the necessary changes in the written loop to make it finite.
x<-0
repeat{
print(x^2)
x<-x+1
if(x<5) print(x) }
The given loop is currently infinite because there is no explicit condition to stop the loop. In the absence of a termination condition, the loop will keep running indefinitely, and it will print the square of `x` and the value of `x` as long as `x` is _______ ______ ____ ______ ___ _______.
___ _________ ______ ____ ___ _________ ________ ________ _____ ____ ______ _____.
__________ ______ ______ _____ ______ ___.
_______ ____ ________ ___ ______ _____ _______ _______ _________ ________ ____ ______.
______ __________ _____ _____ _____ __________ __________ _________ ________.
___ _________ _____ _____ ____ ____ ____ __________ ____ ____ _____ _____.
____ ______ _______ _______ _________ _____.
____ __________ _________ _____ ___ _________ ___ _______ ___ ___.
____ __________ ______ ___ ___.
_________ ____ __________ _______ __________ ______ _____ _______ ___ _______ ___.
______ _______ _________ ____ _____ _________ ____ ____ ___ __________.
________ __________ ______ ______ ____ ____ _________ _____ ______ ________ __________.
_____ ____ _________ _______ _________ ______ ________ ________.
___ __________ _______ _________ ________ _________ _____ ________ ______ _________ ______.
________ ________ _______ ______ ____ __________ __________ ______.
_________ ______ ___ ___ __________ _________ ______ _____.
_________ ______ ______ ________ ______ ______ _________.
_________ _____ _________ _________ ________ _____ __________ _____ _______ _____ ____ ______.
__________ _______ _________ _____ ______.
______ __________ ________ ______ ________ _________ ________.
______ _________ ________ __________ _________ _____ ___ __________ __________ __________.
___ _______.
Get Full Answer on WhatsApp