Hi I am trying to create code to receive input from a user and write it to a file. It is not compiling properly, some error concerning main pops up. what am I doing wrong?
Code:#include<stdio.h> #include <stdlib.h> int main() { FILE *fil; int c; fil=fopen("new.txt", "w"); if(fil==NULL){ printf("error"); exit(1); } printf("Enter some words\n"); scanf("%d", &c); fprintf(fil, "%d", c); fclose(fil); return 0; }