Okay, I tried rewriting this piece of code with getchar in the while loop to manually end the loop with EOF(Ctrl+Z)(I'm using Windows) It worked.
However, any reasons as to why this doesn't work?
Code:#include<stdio.h>
int main (void)
{
int data = 10;
while (data!= EOF)
{
scanf ("%d", &data);
printf("%d",data);
}
return 0;
}