read int with scanf until new line
问题 I'm new to the c language and used java before, so I'm not so familiar with some things... I want to read an indefinite number of integer until there's a new line. I know, that new line is ⁄n and I already have a code, so the integer are read until you type in a letter, but it doesn't stop, if there's a new line. #include <stdio.h> int main() { int i, numberOfNumbs=0,total=0,value, valsRead; float average; valsRead = scanf("%d",&value); while(valsRead>0) { numberOfNumbs++; total +=value;