DEV Community

Sanjar Rashidov
Sanjar Rashidov

Posted on

3 1 1 1 1

for loop

for loop while loop bilan bir xil. Faqatgina yozilishida ozgina farq qilinadi.

Syntax of for loop:
for(initialization; condition; ++/--)
{
statement
}

Masalan:

#include <iostream>

using namespace std;

int main()
{
    for(int n = 1; n <= 7; n++)
    {
        cout << n << endl;
    }

    return 0;
}
Enter fullscreen mode Exit fullscreen mode

for loopdagi o'zgaruvchi for loopdan tashqarida ishlamaydi!

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay