Examveda
Examveda

What is the output of this program?
#include<stdio.h>
#include<fcntl.h>
 
int main()
{
     int fd, fd2, ret;
     fd = open("hello.c",O_RDONLY);
     ret = close(fd2);
     printf("%d\n",ret);
}

A. 0

B. 1

C. -1

D. none of the mentioned

Answer: Option C


This Question Belongs to Computer Science >> Linux

Join The Discussion

Related Questions on Linux