Friday, April 17, 2009

PUTWGETW

#include
void main()
{
FILE *fp;
int v;
clrscr();
fp=fopen("put.txt","w");
/*if(fp==NULL);
{
printf("\nfile does not exit\n");
exit();
}
else*/

printf("Enter nos\n");
while(1)
{
scanf("%d",&v);
if(v==0)
{
return;
}
putw(v,fp);
}
fclose(fp);
fp=fopen("put.txt","r");
while((v=getw(fp)!=EOF)
printf("%d",v)
fclose(fp);
}

No comments: