Help me in solving PPSC268 problem

My issue

File handling in C
So far - whenever you had to accept inputs, you were reading from a system input file.
Similarly - when you had to print output - you were directly printing the output to console.

What if you want to select the files / create new files as part of your input and output?

File handling in C refers to the process of working with files, which are used to store data on a computer’s storage system.
Files can be used to store a wide range of information, such as text, numbers, images, and more.
In C, you can perform various operations on files, such as creating, reading, writing, and updating their content.

Task
Check the code in the IDE.
It helps you see all the files in your directory at the location - /mnt/codechef

My code

#include <stdio.h>
#include <stdlib.h>

void userFunction() {
    /* Show file */
    system("ls -l /mnt/codechef");  // Executes the shell command to list files in /mnt/codechef
}

int main();
    userFunction();  // Calling the function to list the files in the specified directory
    return 0;
}

Learning course: Programming and Problem solving using C
Problem Link: https://www.codechef.com/learn/course/ciet-programming-c/CIETPC37/problems/PPSC268