Program to use getw() and putw() functions
#include<stdio.h> main() { FILE *f1,*f2,*f3; int number,I; int c; printf("Contents of the data file\n\n"); f1=fopen("database.txt","w"); for(I=1;I<3;I++) { scanf("%d",&number); if(number==-1) break; putw(number,f1); } fclose(f1); f1=fopen("database.txt","r"); while((number=getw(f1))!=EOF) printf("%d",number); fclose(f1); getch(); }