Logo 
Search:

C Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C ProgrammingRSS Feeds

C programming practical question 82

  Shared By: Adah Miller    Date: Jan 24    Category: C Programming    Views: 91

Answer:

#include<stdio.h>
main()
{
FILE *ptr;
char i;
ptr=fopen("zzz.c","r");
while((i=fgetch(ptr))!=EOF)
printf("%c",i);
}


Answer:
contents of zzz.c followed by an infinite loop


Explanation:
The condition is checked against EOF, it should be checked against NULL.

Share: 
 

Didn't find what you were looking for? Find more on C programming practical question 82 Or get search suggestion and latest updates.


Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: