#include <stdio.h>

int main() {
    int arr[5] = {1, 2, 3, 4, 5};
    int *p = arr;
    int i;

    printf("Array prima della modifica:\n");
    for (i = 0; i < 5; i++) {
        printf("Elemento %d: %d\n", i, arr[i]);
    }

    for (i = 0; i < 5; i++) {
        *(p + i) *= 2; // Raddoppia ogni elemento tramite il puntatore
    }

    printf("\nArray dopo la modifica:\n");
    for (i = 0; i < 5; i++) {
        printf("Elemento %d: %d\n", i, arr[i]);
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: