To calculate and display you can use loop.
for e.g.int n,sum = 0,c,value; printf("How many numbers you want to add?\n"); scanf("%d", &n); printf("Enter %d integers\n", n); for (c = 1; c <= n; c++) { scanf("%d", &value); sum = sum + value; }