+ 1
can this code print end of file
#include<stdio.h> int main() { int a; a=getchar(); if (a==EOF) { putchar(a); } } if its wrong, pls correct me
5 Answers
+ 5
Hold down Ctrl, press Z. It's ASCII 26.
+ 2
And also you can write the same code with reading from file, you should see the same result.
+ 1
How can you input the EOF character in getchar() using keyboard?
0
i don't know it was in this book
c programming language -by BRIAN W KERNIGHAN & DENNIS M.RITCHIE
ex no 1.7 write a program to print the value of eof
0
thanks guys