#include <stdio.h> int main(void) { long sum = 0L; int count = 10; int i,j; for(i = 1 ; i <= count ; i++ ){ sum = 0L; for(j = 1 ; j <= i ; j++ ) sum += j; printf("\n%d\t%ld", i, sum); } return 0; }
1 1 2 3 3 6 4 10 5 15 6 21 7 28 8 36 9 45 10 55