for loop

Sanjar Rashidov - Nov 2 - - Dev Community

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!

. . . . . . . . . . . . . . . . . . . .