give an example of while loop
Answers
Answered by
2
i = 1
while i < 6:
print(i)
i += 1
Answered by
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
Math,
2 months ago
English,
2 months ago
Math,
2 months ago
English,
5 months ago
Computer Science,
10 months ago
Computer Science,
10 months ago
India Languages,
10 months ago