#include <stdio.h>
int accumulator(int value) {
static int sum = 0; // persists between function calls
sum += value;
return sum;
}
int main() {
printf("%d\n", accumulator(5)); // Output: 5
printf("%d\n", accumulator(3)); // Output: 8
printf("%d\n", accumulator(10)); // Output: 18
return 0;
}