DEV Community

Sanjar Rashidov
Sanjar Rashidov

Posted on

2 1 1 1 1

Arrays

Arrays - bu (massivlar) o'zgaruvchilar turdagi qiymatlarning to'plamidir. Massiv bir xil ma'lumotlarni saqlash uchun ishlatiladi. Massivdagi har bir elementga indeks orqali murojaat qilinadi. Indekslar 0dan boshlanadi.

Masalan:

#include <iostream>

using namespace std;

int main()
{``
    int a [7] = {1,2,3,4,5,6,7}

    for(int i = 0; i < 6;i++)
    {
        cout << i  << ":" << a[i] << endl;
    }

    return 0;
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more