You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
396 B
C

#include<stdio.h>
#include<stdlib.h>
int main()
{
FILE *p;
int i,arr[10];
if((p=fopen("demofile.txt", "wb"))==NULL)
{
printf("\nUnable to open file demofile.txt");
exit(1);
}
printf("\nEnter ten values\n");
for(i=0; i<10; i++)
scanf("%d",&arr[i]);
fwrite(arr,sizeof(arr),1,p);
fclose(p);
return 0;
}