[Solved] how i read new line in integer type input [closed]


The following code will read all ints from standard input, skipping space and newline.

while(1) {
    int ch = getc(stdin);
    if(ch == EOF) break;
    if(ch == '\n') {
        printf("NewLine ......\n");
    }

    ungetc(ch, stdin);
    int x;
    if(scanf("%d", &x) == EOF) break;
    printf("READ:%d:\n", x);
}

5

solved how i read new line in integer type input [closed]