The source code to create an infinite loop using the "until" loop is given below. The given program is compiled and executed successfully.
# Ruby program to create an infinite loop
# using the "until" loop.
flag = false;
until flag==true
puts "Hello";
end
Output:
Hello
Hello
Hello
Hello
.
.
Infinite times
Explanation:
In the above program, we created a Boolean variable flag initialized with false. Then we printed the "Hello" message infinite times using the "until" loop.
Program/Source Code:
The source code to create an infinite loop using the "until" loop is given below. The given program is compiled and executed successfully.
Output:
Explanation:
In the above program, we created a Boolean variable flag initialized with false. Then we printed the "Hello" message infinite times using the "until" loop.
need an explanation for this answer? contact us directly to get an explanation for this answer