--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+
+int main() {
+ char ch;
+ char* fname;
+ FILE* fp;
+
+ printf("Enter the name of the file you wish to see\n");
+ int prt = scanf("%s", fname);
+ /* if (prt != 0) {
+ perror("Error entering the file name.\n");
+ exit(EXIT_FAILURE);
+ } */
+
+ fp = fopen(fname, "r"); /* read mode */
+ if (fp == NULL) {
+ perror("Error while opening the file.\n");
+ exit(EXIT_FAILURE);
+ }
+
+ printf("The content of %s file is :\n", fname);
+
+ while((ch = fgetc(fp)) != EOF)
+ printf("%c", ch);
+
+ fclose(fp);
+
+ return EXIT_SUCCESS;
+}