#include <stdio.h> int main() { FILE *file_ptr; // 1. declare a file pointer file_ptr = fopen("data.txt", "w"); // 2. create a file if(file_ptr !=NULL) // 3. test { printf("File created\n"); fclose(file_ptr); // 4. close the file return 0; } else{printf("Unable to create file.\n"); return 1; } }