do while loop

Do while loop bu while loop bilan bir xil. Ammo “do while loop”ni sharti birinchi holda false bo’lsa ham dastur bir marta ishga tushadi.

Syntax of do while loop:
do
{
statement
++/–
}while(condition)

Masalan:

#include <iostream>

using name…


This content originally appeared on DEV Community and was authored by Sanjar Rashidov

Do while loop bu while loop bilan bir xil. Ammo "do while loop"ni sharti birinchi holda false bo'lsa ham dastur bir marta ishga tushadi.

Syntax of do while loop:
do
{
statement
++/--
}while(condition)

Masalan:

#include <iostream>

using namespace std;

int main()
{
    int n = 1;

    do
    {
        cout << n << endl;
        n++;
    }while(n <= 7);

    return 0;
}


This content originally appeared on DEV Community and was authored by Sanjar Rashidov


Print Share Comment Cite Upload Translate Updates
APA

Sanjar Rashidov | Sciencx (2024-11-02T11:04:15+00:00) do while loop. Retrieved from https://www.scien.cx/2024/11/02/do-while-loop/

MLA
" » do while loop." Sanjar Rashidov | Sciencx - Saturday November 2, 2024, https://www.scien.cx/2024/11/02/do-while-loop/
HARVARD
Sanjar Rashidov | Sciencx Saturday November 2, 2024 » do while loop., viewed ,<https://www.scien.cx/2024/11/02/do-while-loop/>
VANCOUVER
Sanjar Rashidov | Sciencx - » do while loop. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/11/02/do-while-loop/
CHICAGO
" » do while loop." Sanjar Rashidov | Sciencx - Accessed . https://www.scien.cx/2024/11/02/do-while-loop/
IEEE
" » do while loop." Sanjar Rashidov | Sciencx [Online]. Available: https://www.scien.cx/2024/11/02/do-while-loop/. [Accessed: ]
rf:citation
» do while loop | Sanjar Rashidov | Sciencx | https://www.scien.cx/2024/11/02/do-while-loop/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.