Computer Science, asked by mayankchauhan10, 5 months ago

give an example of while loop​

Answers

Answered by makir48713
2

i = 1

while i < 6:

 print(i)

 i += 1

Answered by davetilak003
2

Answer:

Please provide in which language you need the answer

Explanation:

# JAVA

int i = 0;

while (i < 5) {

 System.out.println(i);

 i++;

}

# PYTHON

i = 1

while i < 6:

 print(i)

 i += 1

# C++

int i = 0;

while (i < 5) {

 cout << i << "\n";

 i++;

}

# JAVASCRIPT

while (i < 10) {

 text += "The number is " + i;

 i++;

}

Hope this will be helpful

Similar questions