Dizilerde İleriye Doğru Çift Eleman Güncellemesi

SonsuzUs Her şey › Category: Soru › Dizilerde İleriye Doğru Çift Eleman Güncellemesi
sonsuz Kurucu sordu 20 saat önce
int a[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, i;

int main()
{
    for (i = 0; i < 9; i++)
        if ((a[i] % 2) == 0)
            a[i + 1] = a[i] + a[i + 1];

    for (i = 0; i < 10; i++)
        printf("%d ", a[i]);
}

Yukarıdaki programın çalışması sonucu ekrana basılan konsol çıktısı ne olur?

Cevapla