Program to read data from input file and place first 10 characters in an array and display on the monitor.
#include<stdio.h>
main()
{
FILE *fp;
int i=0;
char c,a[11];
fp=fopen(“INPUT”,”r”);
while(i<100)
{
c=getc(fp);
a[i]=c;
i++;
}
fclose(fp);
a[i]=’\0’;
puts(a);
}

Output: