Another way with awk:
$ awk '{print s+=$1}' file
2
6
13
10
15
13
solved Output subtotal at each line while adding up numbers, one per line
Another way with awk:
$ awk '{print s+=$1}' file
2
6
13
10
15
13
solved Output subtotal at each line while adding up numbers, one per line