Loop - halqa degani.
"While loop"ga bergan shartimiz noto'gri bo'lgunigacha "while loop"ga kiradi va berilgan ishni qayta bajaradi.
Syntax of while loop:
while(comdition)
{
statement
increament/decreament;(++/--)
}
Masalan:
#include <iostream>
using namespace std;
int main()
{
int n = 1;
while(n <= 7)
{
cout << n << endl;
n++;
}
return 0;
}
Top comments (0)