#include <stdio.h>

void add_one(int *b, int size) {
    int i;

    // add one to each element of b
    for (i = 0; i < size; i++) {
        b[i]++;
    }
}

void print_array(int *b, int size) {
    int i;

    for (i = 0; i < size; i++) {
        printf("%d ", b[i]);
    }
}

int main() {
    int a[] = {10, 20, 30, 40};

    // add one to all the elements, and print them.
    add_one(a, 4);
    print_array(a, 4);

    return 0;
}

Embed on website

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