DSA Tutorial - Logic Building : Question 5

Last Updated :
Discuss
Comments

How many times will the following while loop print "Hello"?

x = 5;
while(x > 1) {
print("Hello");
x = x - 1;
}


1

4

6

5

Tags:
Share your thoughts in the comments