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);
}
#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

Join The Discussion