I am just trying to copy and paste the text input. After which the code must show done.
#include <stdio.h>
/*code to copy all input characters and paste it one by one*/
int main()
{
int c;
while ((c = getchar()) != EOF)/* while gets a character, assigns it to c and then tests whether the character was EOF,
if not then the below code is executed*/
{
putchar(c);
}
printf("Done");
return 0;
}
It is like my while loop is not ending because, as soon my input is copied, the code asks me for another input. Hence, it is never showing the Done.
New contributor
Suresh Karthik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
11