#include<stdio.h>

main()

{

FILE *ptr;

char i;

ptr=fopen("zzz.c","r");

while((i=fgetch(ptr))!=EOF)

printf("%c",i);

}



#include<stdio.h> main() { FILE *ptr; char i; ptr..

Answer / susie

Answer :

contents of zzz.c followed by an infinite loop

Explanation:

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

Is This Answer Correct ?    2 Yes 4 No

Post New Answer

More C Code Interview Questions

Print an integer using only putchar. Try doing it without using extra storage.

2 Answers  


void main() { int x,y=2,z; z=(z*=2)+(x=y=z); printf("%d",z); }

4 Answers  


#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }

2 Answers  


why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?

0 Answers  


main() { static int a[3][3]={1,2,3,4,5,6,7,8,9}; int i,j; static *p[]={a,a+1,a+2}; for(i=0;i<3;i++) { for(j=0;j<3;j++) printf("%d\t%d\t%d\t%d\n",*(*(p+i)+j), *(*(j+p)+i),*(*(i+p)+j),*(*(p+j)+i)); } }

1 Answers  


posted by surbhi just now main() { float a = 5.375; char *p; int i; p=(char*)&a; for(i=0;i<=3;i++) printf("%02x",(unsigned char) p[i]); } how is the output of this program is :: 0000ac40 please let me know y this output has come

2 Answers   GATE,


Program to Delete an element from a doubly linked list.

4 Answers   College School Exams Tests, Infosys,


can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail

0 Answers   TCS,


what is oop?

3 Answers  


main() { char i=0; for(;i>=0;i++) ; printf("%d\n",i); }

2 Answers  


main() { char *p; p="Hello"; printf("%c\n",*&*p); }

1 Answers  


Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines

0 Answers   IBM,


Categories