#include <stdio.h>
int main()
{
int n;
FILE *ptr; ///FILE type pointer
ptr=fopen("input.txt","r"); ///read the value
fscanf(ptr,"%d",&n);
fclose(ptr); ///close the file
printf("Scan Value From the Text file is: %d",n);
return 0;
}

Add your comment