I think the problem relies on the array of pointers.Code:#include <stdio.h> #include <stdlib.h> int main() { double day[7]; char** days = {"sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"}; int i; double totalExp; for (i = 0; i < 7; i++){ printf ("Please enter you expenditure for %s: ", days[i][]); days[i++][]; scanf("%f", day[i]); fflush(stdin); totalExp += day[i]; } printf ("total expenditure is: %f", totalExp) getchar(); return 0; }