Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What is the difference between while and do...while in php

Shulou Source: shulou.com Published: 2022-05-31 10:56:18 11月12日 Update

This article mainly introduces the php while and do...while have what different related knowledge, the content is detailed and easy to understand, simple and fast operation, has a certain reference value, I believe that you read this php while and do...while have any different articles will have a harvest, let's take a look at it.

1. Different conditions of use

The functions of do...while and while are similar, except that while judges first and then executes, while do...while executes first and then judges.

Do...while can guarantee that the loop body executes at least once, while while cannot.

two。 Cyclic diagram

3. Example

# include int main () {int iMagne sum = 0position printf ("please enter iMagna iMagneur?"); scanf ("% d", & I); while (I)

Tags: Different knowledge content articles loops values functions examples loops easy to operate articles easy to understand more conditions look industry information channels channels guarantee Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Xiaomi Apple NVidia MariaDB