#include <stdio.h>
int main()
{
int n;
FILE *ptr; ///FILE type pointer
printf("Please Enter A Value: ");
scanf("%d",&n);
ptr=fopen("output.txt","w"); ///create a text file and save value there
fprintf(ptr,"Your Value: %d",n);
fclose(ptr);
return 0;
}

Add your comment