Are the integers in standard input sorted?
int i, /* int in standard input */
after_i, /* number follows i */
eof_flag; /* signal EOF */
scanf("%d", &after_i) ) != EOF ) {
if (i > after_i) /* order OK? */
break; /* if not, terminate */
else /* if OK, update i */
printf("\nfile is not sorted\n");
printf("\nfile is sorted\n");