#include <stdio.h>

// Aの値を1増やし、結果をaに代入
void one_uping(int *A, int *a) {
    *a = *A + 1;
}

// Aの値をB回だけインクリメント
void two_uping(int *A, int B) {  // Bは整数にする
    int C = 0;
    while (C < B) {
        one_uping(A, A);  // Aの値を1増やす
        C++;
    }
}

int main() {
    int x = 1;
    one_uping(&x, &x);  // xを1増やす
    printf("x = %d\n", x);  // x = 2

    int y = 1;
    two_uping(&y, 3);  // yを3回増やす
    printf("y = %d\n", y);  // y = 4

    return 0;
}

Embed on website

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