/* p6.c */ #include int main() { int sum; // the sum of the single digit numbers int value; // the value just read int howmany; // howmany values were read sum = 0; howmany = fscanf(stdin, "%d", &value); while (howmany == 1) { if ((value > -10) && (value < 10)) sum = sum + value; howmany = fscanf(stdin, "%d", &value); } fprintf(stdout, "The sum was was %d \n", sum); return(0); }