Question
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) }
Answer :
Word Count : 235
________ _____ ___ ________ _____ _____.
____ ____ _________ ____ ____ __________ _________ _____ ________.
____ ____ _________ _________ _______.
____ _______ ____ ____ __________ ____ __________ ___ _________ _________ _________.
_______ __________ ___ __________ __________ _________ ______ _____ _______.
____ _________ _______ ________ ____ ______.
________ _____ ______ _________ ________ ________ __________.
__________ _________ _____ ___ _____ ____ _________ _________ _______ _________.
___ ___ ______ _________ ________ ________ _________ _______ ___ ________.
______ _________ _____ ___ ____.
___ ________ __________ ____ ____ _______ ________ ________ ___ _______.
______ _________ _____ _____ _____ _____ ___ ___ __________ ________ ______.
________ ______ _____ _____ _________ _______ _______ ______ ____.
____ __________ ____ __________ ________ _____ ________ _________.
______ ________ _____ _____ ___ _______.
_________ ________ __________ _________ ___ ___ ________ _____.
____ ___ ________ _________ ________ _______.
__________ _____ ___ _______ _______ _______ ____ _______ _________.
_______ ________ _______ __________ _____ _______.
_______ ___ _________ _______ ___ __________ ___.
___ _____ ___ ________ ____ ______ _______ ________ ______ _________.
_________ ____ ______ __________ ___.
___ _____ ____ ________ ______.
__________.
Skip in 10
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 less than 5, but it will never stop.
To
____ ____ _________ ____ ____ __________ _________ _____ ________.
____ ____ _________ _________ _______.
____ _______ ____ ____ __________ ____ __________ ___ _________ _________ _________.
_______ __________ ___ __________ __________ _________ ______ _____ _______.
____ _________ _______ ________ ____ ______.
________ _____ ______ _________ ________ ________ __________.
__________ _________ _____ ___ _____ ____ _________ _________ _______ _________.
___ ___ ______ _________ ________ ________ _________ _______ ___ ________.
______ _________ _____ ___ ____.
___ ________ __________ ____ ____ _______ ________ ________ ___ _______.
______ _________ _____ _____ _____ _____ ___ ___ __________ ________ ______.
________ ______ _____ _____ _________ _______ _______ ______ ____.
____ __________ ____ __________ ________ _____ ________ _________.
______ ________ _____ _____ ___ _______.
_________ ________ __________ _________ ___ ___ ________ _____.
____ ___ ________ _________ ________ _______.
__________ _____ ___ _______ _______ _______ ____ _______ _________.
_______ ________ _______ __________ _____ _______.
_______ ___ _________ _______ ___ __________ ___.
___ _____ ___ ________ ____ ______ _______ ________ ______ _________.
_________ ____ ______ __________ ___.
___ _____ ____ ________ ______.
__________.
IGNOU ACADEMY
Your IGNOU journey, made easier.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
Continue Reading — It's Free
Sign in with Google to unlock more of this answer.
✓ Free access
✓ Unlock up to 60% of the answer
✓ No payment required
✓ Unlock up to 60% of the answer
✓ No payment required
Quick Google sign-in. No separate registration form.