#include<stdio.h>
#include <fcntl.h>
int main()
{
    int fd1 = open("f1.txt", O_RDONLY);
    if (fd1 = = -1)
    {
	perror("c1");
	exit(1);
    }
    printf("opened the fd = % d\n", fd1);

    // Using close system Call
    if (close(fd1) = = -1)
    {
	perror("c1");
	exit(1);
    }
    printf("closed the fd.\n");
    return 0;
}