#include<stdio.h>
#include<conio.h>
void
main()
{
FILE *fp1;
int i,num,total=0,n;
clrscr();
fp1=fopen("n1.txt","w");
printf("\n Enter How Many number
U Want To Store : ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("\n Enter Number
: ");
scanf("%d",&num);
putw(num,fp1);
}
fclose(fp1);
fp1=fopen("n1.txt","r");
printf("\n Content of file
\n");
while((num=getw(fp1))!=EOF)
{
printf("\n
%4d",num);
total=total+num;
}
printf("\n Total = %d
",total);
fclose(fp1);
getch();
}